How to call VB.NET DLL from C++ (Call the functions also - not DLL file only)

前端 未结 4 400
长情又很酷
长情又很酷 2021-01-07 05:38

I want to ask question about how to call VB.NET DLL from C++ program

I have tried many times to call VB.NET DLL file from C++ and it is working fine but the problem

4条回答
  •  孤独总比滥情好
    2021-01-07 06:20

    • GetProcAddress does not understand C++ name mangling, not to mention any other mangling, so there is no dll for which "Class1::example_function1" could be valid identifier. Normally it's only used with extern "C" (or implemented in C without ++) functions, which are not mangled.
    • If it's implemented in VB.NET, it's not a dll at all. It's a .net assembly and you need to be running in CLR (.net runtime) to use it. You can run C++ code in CLR, but it has to be the "Managed C++", which is extended with special types for .net object references and operation with the garbage collector.

提交回复
热议问题