VC 2005 Express 已经在11月7日发布了,我们现在可以用它来Free的进行WTL程序设计。
步骤如下:
1、从MSDN的网站上下载并安装VC Express 2005
http://msdn.microsoft.com/vstudio/express/visualc/
2、下载并安装Platform SDK,并且更新VC Express的设置:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
3、更新Visual C++ 的Include 和Library的Directories设置:
Tools->Option->Projects and Solutions->VC++ Directories->Show directories for:
选择Include目录,然后增加Platform SDK安装目录中的相应目录路径。
Include files: C:\Program Files\Microsoft Platform SDK\include\atl
4、修改Platform SDK\include\atl中的atlwin.h和atlbase.h
1)修改atlwin.h文件 SetChainEntry 函数第1753行,定义其i为int i
---------------------------------------------------------------
for(i = 0; i < m_aChainEntry.GetSize(); i++)
---------------------------------------------------------------
修改为:
---------------------------------------------------------------
for(int i = 0; i < m_aChainEntry.GetSize(); i++)
---------------------------------------------------------------
2) 修改atlbase.h文件中第287行的AllocStdCallThunk 和 FreeStdCallThunk
---------------------------------------------------------------
PVOID __stdcall __AllocStdCallThunk(VOID);
VOID __stdcall __FreeStdCallThunk(PVOID);
#define AllocStdCallThunk() __AllocStdCallThunk()
#define FreeStdCallThunk(p) __FreeStdCallThunk(p)
#pragma comment(lib, "atlthunk.lib")
---------------------------------------------------------------
修改为
---------------------------------------------------------------
/* Comment it
PVOID __stdcall __AllocStdCallThunk(VOID);
VOID __stdcall __FreeStdCallThunk(PVOID);
#define AllocStdCallThunk() __AllocStdCallThunk()
#define FreeStdCallThunk(p) __FreeStdCallThunk(p)
#pragma comment(lib, "atlthunk.lib")
*/
#define AllocStdCallThunk() HeapAlloc(GetProcessHeap(),0,sizeof(_stdcallthunk))
#define FreeStdCallThunk(p) HeapFree(GetProcessHeap(), 0, p)
---------------------------------------------------------------
5、下载并且安装WTL,可以从http://wtl.sourceforge.net/ 下载
6、从yahoo的wtl讨论组,下载AppWizard for VCExpress
http://groups.yahoo.com/group/wtl/files/setup80express.zip
解压缩,并且将其中的*.js文件拷贝至WTL\AppWiz文件夹下,然后双击该js文件,这样就会自动在VC Express中安装WTL的向导。
7、Enjoy VCExpress & WTL
[http://groups.yahoo.com/group/wtl/message/12850]
[author: Baryon Lee]
[Chinese version: Dancefire]