简体   繁体   English

如何将非托管dll中的所有方法导出到托管c#?

[英]How to export all methods in an unmanaged dll to managed c#?

I have a c++ dll with 10 methods and 12 properties, is there any way or any application to export the p/invoke format of the methods to be used in c# ? 我有一个具有10个方法和12个属性的c ++ dll,是否有任何方法或任何应用程序导出要在c#中使用的方法的p / invoke格式? I have use OLE Viewer to inspect all the methods, for example : 我已经使用OLE Viewer来检查所有方法,例如:

[id(0x00000013)] [id(0x00000013)]
BSTR GetCPUID( BSTR GetCPUID(
short BeginAddress, 简短的BeginAddress,
short EndAddress); 简短的EndAddress);

but i dont know how to use this function in c#. 但我不知道如何在C#中使用此功能。

Probably this article may help you 本文可能对您有帮助

http://www.codeproject.com/Articles/18032/How-to-Marshal-aC-Class http://www.codeproject.com/Articles/18032/How-to-Marshal-aC-Class

Let me know if this helps. 让我知道是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM