Click here to Skip to main content
Licence CPOL
First Posted 13 Jan 2006
Views 329,033
Bookmarked 66 times

Using WTL with Visual C++ 2005 Express Edition

By | 13 Jan 2006 | Article
This article explains the procedure for using WTL with Visual Studio 2005 Express edition.

Introduction

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.

History

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

License

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

Member

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.


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
NewsFree Resource Editor PinmemberGiermann21:17 29 Jun '10  
GeneralUsing Windows SDK instead of Platform SDK on VISTA Pinmemberfranzzoa4:28 21 Jun '10  
GeneralBuilding x64 with VC Express PinmemberT800G6:39 5 Apr '10  
NewsATL 7.1 available! PinmemberT800G11:24 27 Aug '09  
GeneralRe: ATL 7.1 available! Pinmembertlj499914:28 29 Jan '11  
AnswerDo it like this PinmemberT800G8:21 7 Jun '11  
NewsWTL 8.1 PinmemberT800G10:41 12 May '09  
Generalx64 warning! Pinmemberdataman64bit5:43 24 Aug '08  
GeneralATL only in Platform SDK 2003 PinmemberT800G14:26 2 Aug '08  
Generalvideo streaming Pinmemberagachouch10:47 15 Jul '08  
Generalwindows vista + Windows (aka Platform) SDK + atlthunk.lib + winnt.h errors -- what worked for me PinmemberMember 27473494:22 28 Apr '08  
QuestionVc 2008 express and WTL ? PinmemberIvan Mladenovic1:39 19 Feb '08  
QuestionRe: Vc 2008 express and WTL ? PinmemberKin Hoon2:38 4 Mar '08  
GeneralRe: Vc 2008 express and WTL ? PinmemberIvan Mladenovic0:27 5 Mar '08  
GeneralRe: Vc 2008 express and WTL ? Pinmember984406222:44 16 Mar '08  
Yesterday, my computer is attacked by virus. I deceided to update the OS from WINXP(sp2) to VISTA. It seemed that all things went well first until i was porting my project based on WTL to the new platform. I downloaded the latest SDK and installed it. After that, I installed VS2008 express and began to build my project while I found there's no ATL head files in the SDK directiory! Does someone have some soultion for my problem?
AnswerRe: Vc 2008 express and WTL ? Pinmembertsehonkit6:53 23 Aug '08  
QuestionWTL wizzard doesn't work PinmemberMember 165025322:34 31 Jan '08  
AnswerRe: WTL wizzard doesn't work Pinmemberoromero5:17 8 Jul '08  
QuestionError while creating a plugin for windows media player. Pinmemberamiya das2:08 4 Jan '08  
QuestionPlatform SDK = Windows SDK? Pinmemberreinux23:47 7 Sep '07  
NewsA Guide to WTL8.0 with VC++2005 express Pinmemberwbkang7:42 23 Jun '07  
QuestionOK, but where are atlcoll.h etc? PinmemberCCanadaK18:21 3 Apr '07  
AnswerRe: OK, but where are atlcoll.h etc? PinmemberEd Gadziemski10:30 22 Jan '09  
Questionmissing the atlthunk.lib ? PinmemberFirkraag21:02 11 Nov '06  
AnswerRe: missing the atlthunk.lib ? PinmemberNuno Esculcas8:20 9 Feb '07  

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

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120529.1 | Last Updated 13 Jan 2006
Article Copyright 2006 by Baryon Lee
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid