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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -