开发者

How to turn .h file +dll into some kind of .Net wrapper?

开发者 https://www.devze.com 2023-01-09 05:30 出处:网络
How toturn .h file +dll into some kind of .Net wrapper? 开发者_如何学编程or something like that? (no C\\C++ sources just h files)If you have the header file, and use many implement from that dll you c

How toturn .h file +dll into some kind of .Net wrapper? 开发者_如何学编程or something like that? (no C\C++ sources just h files)


If you have the header file, and use many implement from that dll you can use swig(http://www.swig.org/) to generate wrapper automatically. Then compile as a dll and invoke the interfaces or class from .Net code.

Or if you only use few method from the dll, just use P/Invoke.


If its straight function calls you should be able to write down the P/Invoke calls.

If its C++ classes, writing a C++ shim DLL is a fairly easy task.

Or, use C++/CLR to write the shim in.

0

精彩评论

暂无评论...
验证码 换一张
取 消