Question VB 2010 callback function DLL c++ 6.0

mattew75

New member
Joined
Sep 22, 2010
Messages
1
Programming Experience
3-5
Hi to all,

I've this problem :

1) I have a DLL developed with Visual C++ 6.0
2) I have done in past a software in VB 6.0 thet correctly use this DLL
3) now I'm trying to upgrade my software to VB 2010 but I have problem with STACK calling the DLL from VB 2010.

I have already read that the problem is about the way of NET marshall the structure to CALLBACK the function but all my trying to solve the problem was not useful.

In deep :

this is my progam in VB 6.0

Public Type STRUTTURA
s(0 To 123) As Byte
byAlarmIn As Byte
byAlarmOut As Byte
byDisk As Byte
byType As Byte
byChan As Byte
byStart As Byte
End Type

Declare Function FUNZIONE Lib "mydll.dll" (ByVal sDVRIP As String, ByVal wDVRPort As Long, ByVal sUserName As String, ByVal byvalsPassword As String, ByRef INFO As STRUTTURA) As Long

and this is the call I do :

Dim I As STRUTTURA

result = FUNZIONE(var1, var2, var3, var4, I)

in VB 6 everything work fine, but translating in VB 2010 I'm not able to do this, because of a problem with the STACK and PInvoke.

I think to be near the solution, introducting the marshalling option but I'm not able to make this functioning.

Can you someone help me to translate this ?

Thanks a lot

Mattew
 
Back
Top