Click here to Skip to main content
15,072,046 members
Articles / Desktop Programming / WTL
Posted 13 Jan 2006


69 bookmarked

Using WTL with Visual C++ 2005 Express Edition

Rate me:
Please Sign up or sign in to vote.
4.87/5 (33 votes)
13 Jan 2006CPOL2 min read
This article explains the procedure for using WTL with Visual Studio 2005 Express edition.


Visual C++ 2005 Express Edition was released on 11/7/2005. It has a great native C++ compiler and a smart editor. The best thing is that it is free. We can use it for our WTL programming for free. I posted the procedure for the same here on 11/9/2005. Now, I am submitting it to CodeProject.

Step by step

  1. Download and install Visual C++ 2005 Express Edition from MSDN.
  2. Download and install the Platform SDK, and update the Visual C++ setting as detailed here.
  3. Update the Visual C++ directories in the Projects section of the Options dialog box. Add the ATL path to the Include files (the path shown is the default, use the path to your actual location):
    C:\Program Files\Microsoft Platform SDK\include\atl
  4. Change atlwin.h and atlbase.h in the ATL folder of the Platform SDK install as follows:
    • Change SetChainEntry function at line 1725 of atlwin.h - define "int i" at the first line of the function body.
      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 line 287 of atlbase.h to the new macros:
      /* 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. Download and install WTL from SourceForge:
  6. Download the AppWizard for Visual Studio 2005 Express from the link above this page, unzip and copy the JS file into the WTL\AppWiz folder, double click it to install the WTL Wizard into VC Express.

Enjoy WTL and VC Express free!

Some Problems

Because VC++ Express doesn't include a "Resource Editor", you will get an error when creating a Dialog or FormView. But, once the project and source files are created, you can open the project directly. If you can find a free resource editor, please tell me.

Comments: rvRoman told us of a free resource editor, and tsehonkit gave us a right link.


  • 1/12/2006 - first submit, for WTL7.5.
  • 1/27/2006 - fixed an editing error.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Baryon Lee
Web Developer
Japan Japan
I write software and share it to make our life more easy and interesting.
Welcome to my site:Share our software. Love Programming, Love Life.

Comments and Discussions

NewsFree Resource Editor Pin
Giermann29-Jun-10 21:17
MemberGiermann29-Jun-10 21:17 
GeneralUsing Windows SDK instead of Platform SDK on VISTA Pin
franzzoa21-Jun-10 4:28
Memberfranzzoa21-Jun-10 4:28 
GeneralBuilding x64 with VC Express Pin
T800G5-Apr-10 6:39
MemberT800G5-Apr-10 6:39 
NewsATL 7.1 available! Pin
T800G27-Aug-09 11:24
MemberT800G27-Aug-09 11:24 
GeneralRe: ATL 7.1 available! Pin
tlj499929-Jan-11 14:28
Membertlj499929-Jan-11 14:28 
AnswerDo it like this Pin
T800G7-Jun-11 8:21
MemberT800G7-Jun-11 8:21 
NewsWTL 8.1 Pin
T800G12-May-09 10:41
MemberT800G12-May-09 10:41 
Generalx64 warning! Pin
dataman64bit24-Aug-08 5:43
Memberdataman64bit24-Aug-08 5:43 
GeneralATL only in Platform SDK 2003 Pin
T800G2-Aug-08 14:26
MemberT800G2-Aug-08 14:26 
Generalvideo streaming Pin
agamus15-Jul-08 10:47
Memberagamus15-Jul-08 10:47 
Generalwindows vista + Windows (aka Platform) SDK + atlthunk.lib + winnt.h errors -- what worked for me Pin
Member 274734928-Apr-08 4:22
MemberMember 274734928-Apr-08 4:22 
QuestionVc 2008 express and WTL ? Pin
Ivan Mladenović19-Feb-08 1:39
MemberIvan Mladenović19-Feb-08 1:39 
QuestionRe: Vc 2008 express and WTL ? Pin
Kin Hoon4-Mar-08 2:38
MemberKin Hoon4-Mar-08 2:38 
GeneralRe: Vc 2008 express and WTL ? Pin
Ivan Mladenović5-Mar-08 0:27
MemberIvan Mladenović5-Mar-08 0:27 
GeneralRe: Vc 2008 express and WTL ? Pin
9844062216-Mar-08 2:44
Member9844062216-Mar-08 2:44 
AnswerRe: Vc 2008 express and WTL ? Pin
tsehonkit23-Aug-08 6:53
Membertsehonkit23-Aug-08 6:53 
QuestionWTL wizzard doesn't work Pin
Member 165025331-Jan-08 22:34
MemberMember 165025331-Jan-08 22:34 
AnswerRe: WTL wizzard doesn't work Pin
oromero8-Jul-08 5:17
Memberoromero8-Jul-08 5:17 
QuestionError while creating a plugin for windows media player. Pin
amiya das4-Jan-08 2:08
Memberamiya das4-Jan-08 2:08 
QuestionPlatform SDK = Windows SDK? Pin
Rei Miyasaka7-Sep-07 23:47
MemberRei Miyasaka7-Sep-07 23:47 
NewsA Guide to WTL8.0 with VC++2005 express Pin
wbkang23-Jun-07 7:42
Memberwbkang23-Jun-07 7:42 
QuestionOK, but where are atlcoll.h etc? Pin
CCanadaK3-Apr-07 18:21
MemberCCanadaK3-Apr-07 18:21 
AnswerRe: OK, but where are atlcoll.h etc? Pin
Ed Gadziemski22-Jan-09 10:30
professionalEd Gadziemski22-Jan-09 10:30 
Questionmissing the atlthunk.lib ? Pin
Firkraag11-Nov-06 21:02
MemberFirkraag11-Nov-06 21:02 
AnswerRe: missing the atlthunk.lib ? Pin
Nuno Esculcas9-Feb-07 8:20
MemberNuno Esculcas9-Feb-07 8:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.