DUMPBIN实用程序损坏的名称输出(DUMPBIN utility mangled name output)

编程入门 行业动态 更新时间:2024-10-27 06:23:04
DUMPBIN实用程序损坏的名称输出(DUMPBIN utility mangled name output)

我正在使用DUMPBIN实用程序从c ++ dll获取损坏的名称以在ac#应用程序中使用。 我正在使用__declspec(dllexport)公开一个c ++类成员函数,输出错位名称结果如下:

?InitPort@CProtocolStack@@QAEEHEPAEKE@Z = ?InitPort@CProtocolStack@@QAEEHEPAEKE@Z (public: unsigned char __thiscall CProtocolStack::InitPort(int,unsigned char,unsigned char *,unsigned long,unsigned char))

导入相同功能时,是否需要在C#应用程序中使用全名? 如果没有,哪一部分足以进口?

I am using DUMPBIN utility for getting mangled name from a c++ dll to use in a c# application . I am exposing a c++ class member function using __declspec(dllexport) and the output mangled name result is the folowing

?InitPort@CProtocolStack@@QAEEHEPAEKE@Z = ?InitPort@CProtocolStack@@QAEEHEPAEKE@Z (public: unsigned char __thiscall CProtocolStack::InitPort(int,unsigned char,unsigned char *,unsigned long,unsigned char))

Do I need to use the whole name in C# application while importing the same function ? If not, which part will be sufficient for importing?

最满意答案

你只需要这个:

?InitPort@CProtocolStack@@QAEEHEPAEKE@Z

然后你宣布它是这样的:

[DllImport("your.dll", EntryPoint = "?InitPort@CProtocolStack@@QAEEHEPAEKE@Z", ExactSpelling = true)] static extern byte CProtocolStack::InitPort( /* etc. */);

You just need this bit:

?InitPort@CProtocolStack@@QAEEHEPAEKE@Z

Then you declare it something like:

[DllImport("your.dll", EntryPoint = "?InitPort@CProtocolStack@@QAEEHEPAEKE@Z", ExactSpelling = true)] static extern byte CProtocolStack::InitPort( /* etc. */);

更多推荐

本文发布于:2023-08-08 00:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466724.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实用程序   名称   DUMPBIN   output   mangled

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!