How to access a VB.NET dll from C++
-
Hello everybody, I need to access some functions in a VB.NET dll from my VC++ application. The problem is that the dll doesn't export any functions like a common dll does. On a microsoft website I found a hint that looks like the .NET dll needs to implement a COM interface to fit my purposes, but I'm not shure. Does anybody have more knowledge on this issue??? MS
-
Hello everybody, I need to access some functions in a VB.NET dll from my VC++ application. The problem is that the dll doesn't export any functions like a common dll does. On a microsoft website I found a hint that looks like the .NET dll needs to implement a COM interface to fit my purposes, but I'm not shure. Does anybody have more knowledge on this issue??? MS
Manfred Staiger wrote:
the .NET dll needs to implement a COM interface to fit my purposes
Not entirly true. VC++ .NET compilers support "mixed mode". Use can use the /clr compiler switch to give your C++ project access to the .NET platform including components authored in nasty VB.NET :) Now it's not quite that simple but that is basically the idea. There are plenty of MSDN resources about project settings etc.
Manfred Staiger wrote:
The problem is that the dll doesn't export any functions like a common dll does.
Correct, everything in .NET is a class. Using "mixed mode" you can create an instance and call the methods, or call the "static" methods of the class of course without an instance. The Code Project (Managed) C++/CLI forum is dedicated to using the VC++ product with the .NET platform so your future questions on this subject should go there. hope that helps