DUMPBIN实用程序错误的名称输出 [英] DUMPBIN utility mangled name output

查看:57
本文介绍了DUMPBIN实用程序错误的名称输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DUMPBIN实用程序从c ++ dll中获取错误的名称,以在c#应用程序中使用。
我正在使用__declspec(dllexport)公开一个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))

导入相同的函数时,我是否需要在C#应用程序中使用全名?
如果不是,那么哪一部分足够导入?

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

然后,您需要声明以下内容:

Then you declare it something like:

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

这篇关于DUMPBIN实用程序错误的名称输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆