VS2010中如何查看DLL的导出接口
解决方法:1. 打开命令行窗口
2. 运行vcvarsall.bat
VS2010里vcvarsall.bat是在D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC目录下,运行方法是直接将vcvarsall.bat文件拖入命令行窗口,然后回车。(拖入相当于在命令行中输入“D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat”)
运行vcvarsall.bat后,窗口中出现“Setting environment for using Microsoft Visual Studio 2010 x86 tools.”
3. 在命令行了输命令:dumpbin /exports dll文件完整路径,即可得到DLL的接口。
如要查看user32.dll的接口,输入:dumpbin /exports “C:\Windows\System32\user32.dll” 回车即可。
其中,步骤2可以省去,方法是不在运行中打开命令行窗口,而是在应用程序Microsoft Visual Studio 2010的Visual Studio Tools文件夹中打开"Visual Studio 命令提示(2010)",可发现窗口中直接有“Setting environment for using Microsoft Visual Studio 2010 x86 tools”这句话,此时,直接输入命令:dumpbin /exports dll文件完整路径,即可得到DLL的接口。点击打开链接
动态链接库时遇到问题:DUMPBIN : fatal error LNK1181: cannot open input file "dll1.dll"
解决方法:若你的dll文件时在C盘中(C:\VC++\Dll1\Debug),那么按下面输入,改变访问位置:
(命令提示符中输入) C: 回车
(输入)cd C:\VC++\Dll1\Debug 回车
(输入)dumpbin -exports Dll1.dll 回车
这样就可以获得被导出函数了点击打开链接