1.1准备工作
(1)建立目标工程,比如“W:WNetTest”
(2) 将“WiMinet.dll”和“WirelessTCP.dll”动态链接库文件放入目标EXE程序的搜索路径中,有两个路径是应用程序必须会搜索的:a) Windows操作系统的公共路径,比如“C:WindowsSystem32” b) 可以执行程序的目录,比如: “W:WNetTest”
(3) 在工程目录“W:WNetTest”建立include子目录“W:WNetTestinclude”,将文件“API-Message.h”和“API-WiMinet.h”文件放入目录“W:WNetTest include”
(4) 在工程目录“W:WNetTest”建立lib子目录“W:WNetTestlib”,将静态链接库文件“WiMinet.lib”和“WirelessTCP.lib”放入目录“W:WNetMgrlib”
1.2 设置头文件包含路径
将头文件的路径“W:WNetTestinclude”加入工程的包含路径中
下图是 Microsoft Visual Studio 6.0的头文件包含路径的设置
下图是Microsoft Visual Studio 2017的头文件包含路径的设置
1.3 设置库文件引用路径
将lib文件的路径“W:WNetTestlib”加入工程的库文件路径中
下图是 Microsoft Visual Studio 6.0的库文件名称设置
下图是 Microsoft Visual Studio 6.0的库文件路径设置
下图是Microsoft Visual Studio 2017的库文件的名称设置
下图是Microsoft Visual Studio 2017的库文件的路径设置
1.4 设置函数调用规范
设置DLL的调用规范为 __cdecl * 的格式
下图是 Microsoft Visual Studio 6.0的设置
下图是Microsoft Visual Studio 2017的截图
1.5同步更新Debug和Release版本
针对Debug版本和Release版本,执行上述步骤1.2,1.3,1.4三个章节的配置
1.6 Visual Studio 6.0和2017的工程管理
Microsoft Visual Studio 6.0的工程文件尾缀是 *.dsp 以及 *.dsw;Microsoft
Visual Studio 2017的工程文件的尾缀是 *.sln。
由于Windows 操作系统文件关联的设置,有可能双击 *.dsp 或者 *.dsw 工程文件的时候,仍然会采用Microsoft Visual Studio 2017打开。精确控制打开的集成开发环境,有下述两种方法:
1. 先启动Microsoft Visual Studio 6.0,然后从菜单“File”中选择“Open Workspace”打开工程。
2. 右键单击 *.dsp或者*.dsw文件,选择“打开方式”,然后通过“打开方式”的二级子菜单选择“Microsoft(R) Developer Stduio”打开Microsoft Visual Studio 6.0集成开发环境。
1.7注意事项
Microsoft Visual C++ 6.0 在Windows 10操作系统上运行的时候,有权限方面的兼容性问题。在单步运行Step into/over的时候,会弹出来“OLE Remote Procedure
Call”的警告,此时需要以管理员身份运行Microsoft Visual C++ 6.0的程序组件即可。
具体如下:选中Microsoft Visual C++ 6.0的程序图标,右键弹出菜单,选中“以管理员身份运行”即可。
1.8清除Visual Stdudio临时文件
Microsoft Visual Stdudio集成开发环境会在编译过程中产生临时文件,为了清除这些文件,可以执行根目录的批处理文件“del.VCTemp.bat”,用记事本打开(Win+R调出“运行”命令,输入notepad并回车确认,然后用鼠标将该文件拖入notepad空白处并释放鼠标),显示其内容如下:
del /s *.pdb
del /s *.pch
del /s *.ilk
del /s *.log
del /s *.tlog
del /s *.ncb
del /s *.plg
del /s *.opt
del /s *.obj
del /s *.htm
rem Delete [Version]......
rmdir /S/Q VersionBackup
rmdir /S/Q Version.vs
rmdir /S/Q VersionDebugWNetTest.tlog
rmdir /S/Q VersionReleaseWNetTest.tlog
rem Delete [Send]......
rmdir /S/Q SendBackup
rmdir /S/Q Send.vs
rmdir /S/Q SendDebugWNetTest.tlog
rmdir /S/Q SendReleaseWNetTest.tlog
rem Delete [Recv]......
rmdir /S/Q RecvBackup
rmdir /S/Q Recv.vs
rmdir /S/Q RecvDebugWNetTest.tlog
rmdir /S/Q RecvReleaseWNetTest.tlog
rem Delete [eWOR]......
rmdir /S/Q eWORBackup
rmdir /S/Q eWOR.vs
rmdir /S/Q eWORDebugWNetTest.tlog
rmdir /S/Q eWORReleaseWNetTest.tlog
rem Delete [BMP]......
rmdir /S/Q BMPBackup
rmdir /S/Q BMP.vs
rmdir /S/Q BMPDebugWNetTest.tlog
rmdir /S/Q BMPReleaseWNetTest.tlog
rem Delete [[App-01].eWOR+Send]......
rmdir /S/Q [App-01].eWOR+SendBackup
rmdir /S/Q [App-01].eWOR+Send.vs
rmdir /S/Q [App-01].eWOR+SendDebugWNetTest.tlog
rmdir /S/Q [App-01].eWOR+SendReleaseWNetTest.tlog
电话:010-57222007 13911821802 邮箱:dingyg99@126.com
版权所有 © 微网高通(北京)无线技术有限公司 未经许可 严禁复制