Calling an unmanaged c++ function having arguments as pointers from VB.Net -
i've following function written in unmanaged c++, , i'd call vb.net code. main problem me function asks first argument passed pointer. , in visual basic don't have pointers c++.
so how can call function vb.net?
__declspec(dllexport) void __stdcall setup(char *name, int &maxchars)
i'd p/invoke this:
imports system.runtime.interopservices .... <dllimport("mylib.dll", charset:=charset.ansi)> _ private sub setup(byval name string, byref maxchars integer) end sub you need specify character set ansi since c code receives char*. don't need specify calling convention since default stdcall matches native code.
Comments
Post a Comment