Tag Archives: Windows

How to use WTL 9.0 with Visual Studio Express 2013

Standard

Visual Studio Expression does not come with ATL headers such as atlbase.h required by WTL. The good news is Windows Driver Kit (WDK) have these files (older version, but works). We also need Windows SDK that provide header files such as windows.h and other lib files. In short, to use WTL with Visual Studio Express 2013, you need to download and install:

  1. Windows SDK (I used v7.0, higher version should work as well)
  2. Windows Driver Kit: http://www.microsoft.com/en-us/download/confirmation.aspx?id=11800
  3. Visual Studio Express
  4. WTL (latest version is 9.0, unzip and run /AppWiz/Setup.js to install AppWizard for Visual Studio 2013)

After you have all these packages installed on your machine, you can create a SDI project with WTL AppWizard. However, in order to compile, you need to do some configurations (the folder need to be set is shown in the images):

1.  Set the folder for header files, including WTL headers, ATL headers (come with WDK) and Windows headers (come with Windows SDK)

ImageImage

2.  Set the folder for resource headers

ImageImage

 

3.  Finally, add folders that contain lib files, including ATL lib files (32-bit and 64-bit version) and windows lib files (kernal32.lib etc.)

ImageImage

 

That’s it!

create and use precompiled header in visual studio

Standard

When you create a project with a wizard (MFC, Win32, WTL etc.), the precompiled header are usually setup for you. However, if you start from an empty project, you will need to go through the following steps:

1) add your source files into the project, include stdafx.h and stdafx.cpp

2) Right click the project in Solution Explorer and select Properties.  Go to: Configuration Properties => C/C++ => Precompiled Headers.  On the right side, set “Use (/Yu)” for “Precompiled Header”.

3) Right click your stdafx.cpp and select Properties.  Go to the same location: Configuration Properties => C/C++ => Precompiled Headers.  On the right side, set “Create (/Yc)” for “Precompiled Header”. Done.