开发者

How to use C functions from dll in .net(C#)?

开发者 https://www.devze.com 2023-03-09 23:48 出处:网络
If there\'s a dll written on C, then how is it possible to use it in .net(C#)? Is it strictly necessary to write a header file for it in order to data types be compatible b开发者_Python百科etween two

If there's a dll written on C, then how is it possible to use it in .net(C#)?

Is it strictly necessary to write a header file for it in order to data types be compatible b开发者_Python百科etween two languages?


You already know about P/invoke from your previous question. Regarding the header file, it's not used for managed interop. Instead the P/invoke declarations specify the function parameters, calling conventions etc.


Yes, it's possible. It's called unmanaged DLL. There are quite a few tutorials in this regards. One of them i had from before when i was working in this similar aspect is: [1] http://www.codeproject.com/KB/mcpp/usingcppdll.aspx

0

精彩评论

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