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