Friday, December 26, 2008

Use WTL under VCExpress

VCExpress was released in 11/7
We can use it for our wtl programming free.

1,Download and Install VCExpress 2005 from MSDN.
http://msdn.microsoft.com/vstudio/express/visualc/
2,Download, Install PSDK, and Update VCExpress Setting. Detail:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
3,Update the Visual C++ directories in the Projects and Solutions
section in the Options dialog box.Add atl path.
Include files: C:\Program Files\Microsoft Platform SDK\include\atl

4, Change atlwin.h and atlbase.h in PSDK\ATL folder

Change SetChainEntry function at L1725 of atlwin.h,define "int i" at first。
---------------------------------------------------------------
BOOL SetChainEntry(DWORD dwChainID, CMessageMap* pObject, DWORD
dwMsgMapID = 0)
{
int i;
// first search for an existing entry

for(i = 0; i < m_aChainEntry.GetSize(); i++)
---------------------------------------------------------------

Change AllocStdCallThunk and FreeStdCallThunk at L287 of atlbase.h,to new
macro
---------------------------------------------------------------
/* 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)
---------------------------------------------------------------

3,Download and Install the WTL from http://wtl.sf.net
4, Download AppWizard for VCExpress from
http://groups.yahoo.com/group/wtl/files/setup80express.zip
Unzip and Copy JS file into WTL\AppWiz folder, double click it to
install WTL Wizard into VCExpress

Enjoy VCExpress&WTL

No comments: