-
Sorcerer Supreme
[C++] Dll + Visual basic ( URGENT )
hey guys, i want to call a function from a dll writed in c++
the c++ header of the function is:
int __stdcall MyFunc(unsigned char*Arg1,unsigned char*Arg2,int Arg3);
i added this to the top of visual basic code:
Public Declare Function MyFunc Lib "MyFunctions.dll" (ByVal Arg1 As Long, ByVal Arg2 As Long, ByVal Arg3 As Long) As Long
it still dont works
obs: arg1 and arg2 is pointers and i'm calling it as
return = MyFunc(VarPtr(bytearray(0), VarPtr(bytearray2(0)), mylongarg)
what i should do for this ** work?
-
-
Grand Master
Erm, to make that work you must suply the function with pointers, ie memory-adresses. If there isn't a pointer in VB, try the referenced value. Or use google ofcourse to search for pointers in VB
-
Sorcerer Supreme
-
Grand Master
Ah, silly me :icon6: Still, my knowladge of VB is minimal I'm affraid..
Whats the error though? That'll probably shed some light into this situation.. :)
-
Grand Master
I don't think the first two should be "ByVal". The other way of passing parameters (I forgot what it's called...)
-
Sorcerer Supreme
-
Grand Master

Originally Posted by
wolfulus
byref?
Yes. Ja. Oui.