vb.netdlldllimportvisual-c++-2008

How to call parameterized function from the dll in VB.Net


I have visual c++ .dll file which I have added as the reference in VB.Net project. That created Interop.mydlllib.dll.

Now I want to use the function having three parameters from dll inside my one function.

How to call this VC++ dll function inside my VB.Net function.

I'm very new to VB.Net, so any help is appreciated... :)

(I searched on the internet and tried the ways suggested there...but still error ... :( )


Solution

  • If you've referenced a Dll inside a VB project, then you will simply need to call it from it's namespace.

    I.e. inside the C++ project there will be something (Probably the application/dll name) that it will register itself under.

    From here, you simply need to start typing for intellisense to kick in and you'll see the name of your Dll listed in the dropdown list. Select that name and you should see your function name that you'll be able to call.