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@ZThen you declare it something like:
[DllImport("your.dll", EntryPoint = "?InitPort@CProtocolStack@@QAEEHEPAEKE@Z", ExactSpelling = true)] static extern byte CProtocolStack::InitPort( /* etc. */);更多推荐
发布评论