如何添加进向导:1.下载WTL8.0 , WTL80下载:可以从http://www.sf.net/下载,下载地址为:wtl80
2.将WTL80解压至c:\wtl80目录。将c:\wtl80\appwiz\setup80.js复制为setup90.js,用记事本打开setup90.js,打开编辑菜单中的替换命令, 将8.0全部替换为9.0后保存。运行setup90.js即可将WTL80的应用程序向导安装至VS2008中。打末VS2008,选择Tools->Options- >Projects and Solutions->VC++ Directories,在include中将c:\wtl80\include加入。
3.安装VisualFC,将vfc_0.71bin解压至c:\visualfc目录,将vs2008addin解压至c:\visualfc\bin目录中,运行regvs2005.bin注册 FreeCode2005.dll文件,编辑installvs2008.reg文件,将其中的"SatelliteDLLPath"="c:\\VisualFC\\bin"改为你自己机器上的实际目录,运行 installvs2008.reg文件将安装VisualFC插件至VS2008开发环境中。为了使用VFC的对话框字体设计功能,可以将c:\visualfc\bin\vfcfonts.h 复制至c:\wtl80\include目录中。
4.打开VS2008,新建项目,应该可以看到WTL/ATL Applicaton Wizard了。我们选择一个对话框应用程序,点击Tool中的VFC_WTL即可以使用 WTL的类向导为WTL应用程序添加各种功能了。
在编译时会遇到一些问题:
一. : error C2084: 函数“HRESULT ATL::CComModule::RegisterClassObjects(DWORD,DWORD) throw()”已有主体
1> D:/Program Files/Microsoft Visual Studio 9.0/VC/ce/atlmfc/include/atlbase.h(4471) : 参见“RegisterClassObjects”的前一个定义
解决方法:
在atlapp.h中找到下面的代码,并用预定义宏包含起来
#ifndef _WIN32_WCE // Fix by linyehui 2010/5/5 11:15:13
namespace ATL
{
inline HRESULT CComModule::RegisterClassObjects(DWORD /*dwClsContext*/, DWORD /*dwFlags*/) throw()
{ return E_NOTIMPL; }
inline HRESULT CComModule::RevokeClassObjects() throw()
{ return E_NOTIMPL; }
}; // namespace ATL
#endif
问题二:C3861: 'lstrcpynA': identifier not found
The way to fix it is simple, just add:
#if _ATL_VER == 0x900
#define _SECURE_ATL 1
#endif
just before the include of atlapp.h