473,668 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need Help It is urgent


Hy,
I have a problem at which I can not find the solution:
I have this:
Declare Sub VRB_IO_StdInste l Lib "TWVRB408.D LL" Alias
"_VRB_IO_StdIns tel@12" (ByVal Mode As Integer, ByVal szIniFile As
String, ByRef pStdInstel As STR_STANDAARD_I NSTELLINGEN)
Structure STR_STANDAARD_I NSTELLINGEN
Dim VerbType As Integer ' Verbindingstype : 1..6
Dim DoorgaandProfie l As Integer ' Doorgaand profiel: 1=kol,
2=lig
Dim Fyd As Integer ' Rekenwaarde vloeispanning
Dim KlassKonstr As Integer ' Klassifikatie konstruktie:
1=ongeschoord, 2=geschoord
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=2)> _
Dim padding_1() As Byte ' Boutkwaliteit
Dim BoutKwaliteit As Integer ' Boutkwaliteit
Dim MilieuKorrosief As Integer ' Milieu korrosief: 0=nee, 1=ja

<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=2)> _
Dim padding_2() As Byte ' Ankerkwaliteit
Dim AnkerKwaliteit As Integer ' Ankerkwaliteit
Dim BetonKwaliteit As Integer ' Betonkwaliteit
Dim VoegKwaliteit As Integer ' Voegkwaliteit
Dim EBeton As Integer ' E-modulus beton
Dim EVoeg As Integer ' E-modulus voeg
Dim Norm As Integer ' Default normkeuze: NT_TGB etc.
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=260) > _
Dim ProfLijst() As Byte ' Naam van actueel gekozen profiellijst

<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=240) > _
Dim Profiel(,) As Byte ' Laatst gebruikte profielnamen in
wizard
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=2)> _
Dim padding_3() As Byte ' Default eindmaat e1 (... * d)
Dim EindmaatE1 As Integer ' Default eindmaat e1 (... * d)
Dim SteekmaatS1 As Integer ' Default steekmaat s1 (... * d)
' !!! Bufferlengte is: 552
Public Sub Initialize()
ReDim padding_1(2)
ReDim padding_2(2)
ReDim ProfLijst(260)
ReDim Profiel(48, 5)
ReDim padding_3(2)
End Sub
End Structure
And when I try to call the function VRB_IO_StdInste l in the procedure:
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim f As New STR_STANDAARD_I NSTELLINGEN
f.Initialize()
VRB_IO_StdInste l(0, "C:\Windows\TsW in.ini", f)
End Sub
it give an error like this:
"An unhandled exception of type 'System.TypeLoa dException' occurred in
WindowsApplicat ion1.exe

Additional information: Can not marshal field Profiel of type
STR_STANDAARD_I NSTELLINGEN: This type can not be marshaled as a
structure field."

Could anyone give me a solution for this error?
Please it is urgent to solve this.
Thanks
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2276430

Nov 23 '05 #1
3 1508
Hi,

"avy31" <av**********@n o-mx.forums.yourd omain.com.au> wrote in message
news:av******** **@no-mx.forums.yourd omain.com.au...

Hy,
I have a problem at which I can not find the solution:
I have this:
Declare Sub VRB_IO_StdInste l Lib "TWVRB408.D LL" Alias
"_VRB_IO_StdIns tel@12" (ByVal Mode As Integer, ByVal szIniFile As
String, ByRef pStdInstel As STR_STANDAARD_I NSTELLINGEN)
Structure STR_STANDAARD_I NSTELLINGEN
Dim VerbType As Integer ' Verbindingstype : 1..6
Dim DoorgaandProfie l As Integer ' Doorgaand profiel: 1=kol,
2=lig
Dim Fyd As Integer ' Rekenwaarde vloeispanning
Dim KlassKonstr As Integer ' Klassifikatie konstruktie:
1=ongeschoord, 2=geschoord
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=2)> _
Dim padding_1() As Byte ' Boutkwaliteit
Dim BoutKwaliteit As Integer ' Boutkwaliteit
Dim MilieuKorrosief As Integer ' Milieu korrosief: 0=nee, 1=ja

<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=2)> _
Dim padding_2() As Byte ' Ankerkwaliteit
Dim AnkerKwaliteit As Integer ' Ankerkwaliteit
Dim BetonKwaliteit As Integer ' Betonkwaliteit
Dim VoegKwaliteit As Integer ' Voegkwaliteit
Dim EBeton As Integer ' E-modulus beton
Dim EVoeg As Integer ' E-modulus voeg
Dim Norm As Integer ' Default normkeuze: NT_TGB etc.
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=260) > _
Dim ProfLijst() As Byte ' Naam van actueel gekozen profiellijst

<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=240) > _
Dim Profiel(,) As Byte ' Laatst gebruikte profielnamen in
wizard
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=2)> _
Dim padding_3() As Byte ' Default eindmaat e1 (... * d)
Dim EindmaatE1 As Integer ' Default eindmaat e1 (... * d)
Dim SteekmaatS1 As Integer ' Default steekmaat s1 (... * d)
' !!! Bufferlengte is: 552
Public Sub Initialize()
ReDim padding_1(2)
ReDim padding_2(2)
ReDim ProfLijst(260)
ReDim Profiel(48, 5)
ReDim padding_3(2)
End Sub
End Structure
And when I try to call the function VRB_IO_StdInste l in the procedure:
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim f As New STR_STANDAARD_I NSTELLINGEN
f.Initialize()
VRB_IO_StdInste l(0, "C:\Windows\TsW in.ini", f)
End Sub
it give an error like this:
"An unhandled exception of type 'System.TypeLoa dException' occurred in
WindowsApplicat ion1.exe

Additional information: Can not marshal field Profiel of type
STR_STANDAARD_I NSTELLINGEN: This type can not be marshaled as a
structure field."

Could anyone give me a solution for this error?
Dim Profiel(,) As Byte ' Laatst gebruikte profielnamen in wizard

Pinvoke doesn't support multi-dimension arrays inside structures, you can
declare a single-dimension array whose length is the multiplication of the
two dimensions.

HTH
Greetings
Please it is urgent to solve this.
Thanks
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2276430

Nov 23 '05 #2

Hy
Thanks for your help.Seems to be the only solution.
But it is hard to apply because the 2 dimension array is used in other
parts of the application as 2 dimension array.
Do you have another solution?How can I call the parameter as structure
in DLL function to solve this problem without change the 2 dimension
array?

Greetings
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2276430

Nov 23 '05 #3
Hi,

"avy31" <av**********@n o-mx.forums.yourd omain.com.au> wrote in message
news:av******** **@no-mx.forums.yourd omain.com.au...

Hy
Thanks for your help.Seems to be the only solution.
But it is hard to apply because the 2 dimension array is used in other
parts of the application as 2 dimension array.
Instead of accessing it like data[i,j], you can access it like data[(i*jd) +
j] (where jd is the second dimension).

You could also use Buffer.BlockCop y to copy the single dimension array to a
mutli dimension array (and back).

HTH,
Greetings
Do you have another solution?How can I call the parameter as structure
in DLL function to solve this problem without change the 2 dimension
array?

Greetings
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2276430

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1639
by: Rahul S. | last post by:
Hey all: I need urgent information how to set the environment in Visual.NET wiritng in C. I am working with a licensed version of the Analyze 6.0 software from mayo clinic. I need to write code in C using AVW functions that are licensed by Mayo clinic. In order to access the AVW library of functions, I need to set the
3
1741
by: Rahul S. | last post by:
Hey all: I need urgent information how to set the environment in Visual.NET wiritng in C. I am working with a licensed version of the Analyze 6.0 software from mayo clinic. I need to write code in C using AVW functions that are licensed by Mayo clinic. In order to access the AVW library of functions, I need to set the
28
3028
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
2928
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
15
4598
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
2
9081
by: Max Power | last post by:
Hi All I am coding a small app in that swaps specific files between a client and server. All files and locations are set at both sides. I want my app to show a file list, based on the file names, from the local and remote machine..... Local is not a problem and works OK. but I am trying :: Form1.getFile.FileName = Inet1.Execute("ftp://ftp.server.net", "DIR") and I
3
6457
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
3
7609
by: Noremac | last post by:
My google skills must be dwindling. I am trying to determine how in ASP.NET 2.0 I can get the ReturnUrl querystring variable in Forms Authentication to contain the absolute url. Just like others that have posed this question, we are an enterprise environment that has multiple websites across multiple servers and we are trying to setup Web SSO for our public internet site that will be accessible by our clients. ASP.NET seems to have...
9
1687
needhelp123
by: needhelp123 | last post by:
Can any one send me a quick sort simple logic pogram... its very urgent urgent
1
2117
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8889
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8652
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2782
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.