Creating simple c++.net wrapper. Step-by-step

前端 未结 2 1616
我寻月下人不归
我寻月下人不归 2020-11-28 22:38

I\'ve a c++ project. I admit that I\'m a complete ZERO in c++. But still I need to write a c++.net wrapper so I could work with an unmanaged c++ library using it. So what I

2条回答
  •  野性不改
    2020-11-28 23:00

    You need to use p/invoke from .NET to talk to your unmanaged DLL.

    Essentially you create a function header for each function you want to call in your unmanaged DLL, and tell .NET which DLL the function lives in, then just call that function like any other in your .NET wrapper.

    You shouldn't even need any C++ knowledge - as long as you know the function definition of the functions in your unmanaged DLL, and the correct datatypes.

提交回复
热议问题