简体   繁体   English

dumpbin命令未在dll中列出函数名称

[英]dumpbin command not listing function names in dll

I have a DLL which is develeoped in VB.Net. 我有一个在VB.Net中开发的DLL。 I am trying to call its functions from my vc++ code. 我试图从我的vc ++代码中调用其功能。 The dll has successfully loaded using LoadLibrary function. DLL已使用LoadLibrary函数成功加载。 But when I try calling any function within the dll, it gives a null pointer exception. 但是,当我尝试调用dll中的任何函数时,它会给出一个空指针异常。

I used the dumpbin command to confirm the function arguments within my dll. 我使用dumpbin命令来确认dll中的函数参数。 But it is not listing any functions. 但是它没有列出任何功能。 Could it be a problem with the dll or does dumpbin support few dlls only? dll可能有问题吗,或者dumpbin仅支持少数dll? Please help! 请帮忙!

C:\\Program Files (x86)\\Microsoft Visual Studio 11.0>dumpbin ECR.dll Microsoft (R) COFF/PE Dumper Version 11.00.51106.1 Copyright (C) Microsoft Corporation. C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0> dumpbin ECR.dll Microsoft(R)COFF / PE Dumper版本11.00.51106.1版权所有(C)Microsoft Corporation。 All rights reserved. 版权所有。

Dump of file ECR.dll 转储文件ECR.dll

File Type: DLL 档案类型:DLL

Summary 摘要

  2000 .reloc 4000 .rsrc 2000 .sdata 16000 .text 

Try writing before any function in your DLL file (header .h files) the name of the project with _API at the end (ECR_API). 尝试在DLL文件(标头.h文件)中的任何函数之前写入项目名称,并在末尾带有_API(ECR_API)。

for example, lets say we want to create a constructor and destructor for a class called Loader: 例如,假设我们要为名为Loader的类创建构造函数和析构函数:

class Loader{
    public:
        ECR_API Loader();
        ECR_API ~Loader();
}

also dont forget to add export and import statements at the beggining of your header file: 也不要忘记在头文件的开头添加导出和导入语句:

#ifdef ECR_EXPORTS
#define ECR_API __declspec(dllexport)
#else
#define ECR __declspec(dllimport)
#endif

hope this helps! 希望这可以帮助! worked fine for me. 对我来说很好。

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

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