Click here to Skip to main content
Click here to Skip to main content

Introduction to WTL - Part 1

By , 30 Apr 2001
 

What is the Windows Template Library you ask?

Brief history

In the beginning when ATL appeared, developers were happy. We had a way to write fast, small COM components. Well the happiness ended soon after when we found that we had to write code wrappers for any of the window's controls we wanted to use. So MS responded to our plight and gave us WTL, completely unfinished and unsupported (for now).

See WTL Documented for more information.

Features

  • All the power of C++
  • Thin wrappers for the common controls
  • A small but functional Application framework (minus the ever-popular Document-View Architecture)
  • Print and Print Preview support
  • Ports of MFC’s CPoint, CRect, CSize, CString, etc.
  • New Message cracking Macros, conceivably they’re an upgrade of the existing ones.

All this but no documentation! Oh well, we're all professionals and can read code, so for now that will have to suffice.

Where do you get it?

Thanks to Nenad Stefanovic of the WTL development team we now have 2 methods of downloading the WTL source file (Special thanks to Shannon McCoy for pointing this out).

Method 1

Click here to download the WTL source files.

Method 2

Go and get the Platform SDKs.

WTL resides in the Platform SDKs. To find and install WTL you need to download the latest release of the Platform SDKs. In the screen seen below, Expand the Source code tree item and select the Windows Template Library for download.

So, you have the SDKs installed, your ready to go... well almost. Don’t forget to add the WTL include path to Developer Studio. To do that in Developer Studio go to Tools | Options and click on the 'Directories' tab. Once you are there simply add the include path to the 'Include files' list.

What’s in the box?

Let’s take a look at the goodies we got. The WTL is setup so that all the code resides in header files; it's setup this way so that we have full control of what is been tacked into your project.

The Headers

File name Description
   
atlapp.h Message loop, interfaces, general app stuff
atlcrack.h Message cracker macros atlctrls.h Standard and common control classes
atlctrlw.h Command bar class atlctrlx.h Bitmap button, check list view, and other controls
atlddx.h Data exchange for dialogs and windows
atldlgs.h Common dialog classes, property sheet and page classes
atlframe.h Frame window classes, MDI, update UI classes
atlgdi.h

DC classes, GDI object classes

atlmisc.h

ATL ports of CPoint, CRect, CSize, CString, etc.

atlprint.h

Printing and print preview

atlres.h Standard resource Ids
atlscrl.h Scrollable windows
atlsplit.h Splitter windows
atluser.h Menu class

The Samples

Directory Description
   
MTPad

Multithreaded notepad sample

MDIDocVw

ATL version of the MDI sample

GuidGen

ATL version of the GuidGen sample

The App-Wizard

File Name Description
   
AtlApp60.Awx ATL/WTL AppWizard

And of course there is a 'readme.txt', which outlines the class hierarchy of the WTL. Sorry, I said there was no documentation, my bad :)

Thats it! You got the WTL and your ready to go.

Ben Burnett

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Ben Burnett
Student University of Lethbridge
Canada Canada
Member
Ben was born in New Zealand and grew up in Mexico; however, he has lived in Canada for most of his adult life. He has traveled to a few places in Canada so far: British Columbia, Saskatchewan, Manitoba, Ontario and Nova Scotia, but has only ever lived in Alberta — all over Alberta. From Lethbridge to Calgary to Fort McMurray: he has seen most of what the province has to offer. He has also left the comfort of his—at the time—home country and gone abroad. In recent history he has been in China, New Zealand, the US, Central America and back to Canada (where he now resides).
 
He completed a degree at the University of Lethbridge, in Computer Science; worked for the University of Wisconsin-Madison in the Computer Sciences Department as a Systems Programmer for the Condor Research Project[^]; and is currently completing another degree at the University of Lethbridge, once again, in Computer Science.
 
Ben has been known to enjoy reading, watching movies, playing console games, and learning everything he can about computers. And, more importantly, with regards to his character: does not usually speaks about himself in the third person.

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.
Search this forum  
    Spacing  Noise  Layout  Per page   
AnswerRe: Why do we need WTL?memberSoliant16 Feb '03 - 15:06 
Search WTL on MSDN
 
WTL allows developers to avoid writing tedious WinAPI routines. It also provides a lightweight framework for UI programming, which leaves much smaller footprint than MFC.
 
However, WTL is not supported or documented by it's creators.
 




R.Bischoff | C++
 
.NET, Kommst du mit?

QuestionHow to install WTL in C++memberGOLDEN15 May '02 - 6:14 
Who can tell me how to install wtl31.exe on my VC++ ?
I want to complier a sample but there is a error . The
error message is "fatal error C1083: Cannot open include file: 'atlctrls.h': No such file or directory"
 
I have the wtl31.exe but I don't know how to use .
please everyone send e-mail tell me how to do .
my e-mail is "goldchicken2000@yahoo.com.tw"
AnswerRe: How to install WTL in C++memberRamon Casellas15 May '02 - 6:22 
Get the WTL 7.0 version (search here in codeproject for a link). WTL7.0 contains some bug fixes and enhancements.
 
unpack the wtl70.exe somewhere. There are .js files for both VC++ 6.0 and .NET. Add the include directory to the ide/project options, and it should work.
 
R.

GeneralRe: How to install WTL in C++memberGOLDEN16 May '02 - 5:36 
Ramon Casellas
 
Sorry , i don't know what is the meaning of "ide/project options".
 
I download the WTL 7.0 , unpack it , run the setup.js and
make new directory(WTL\include) to the C:\~\Microsoft Visual Studio\VC98\include but run the demo program will find a error . I see the readme.htm but can't solve the problem . Please teach me detail .

GeneralRe: How to install WTL in C++memberxc25 May '02 - 22:45 
1.Copy the .h files in WTL's include directory to VC's include directory.
2.Suppose your vc is under D:,copy the AtlApp60.Awx in WTL's appwiz directory to
D:\Microsoft Visual Studio\Common\MSDev98\Bin\IDE,
that is ok!then when u open vc Wizard,u will see an extral project to choose "WTL project".
Hope u enjoy it!
 
xc
GeneralRe: How to install WTL in C++memberzoom19 Nov '02 - 22:02 
but I found that the WTL7.0 example programes couldn't be passed the compiling I don't know the reason the compiling result is shown below:
atlframe.h(274) : error C2146: syntax error : missingConfused | :confused: ';' before identifier 'lpnm'
the reason is the source code appears like this:
LPNMREBARCHEVRON lpnm;
my question is which head file include the defination of
"LPNMREBARCHEVRON "?
 
I am interesting in programming with VC++. I hope to meet the net freinds with the same interesting. I am glad to know the better programmer on internet.
GeneralRe: How to install WTL in C++memberideras9 Jul '03 - 16:04 
I had the same problem compiling MTPad in VC++6.0. I change the following line in stdatl.h
 
#define _WIN32_IE 0x0501
 
to
 
#define _WIN32_IE 0x0400
 
and the compile well ...

GeneralRe: How to install WTL in C++membercc541617 Feb '05 - 16:33 
I had the same problem compiling MTPad in VC++6.0. I change the following line in stdatl.h
 
#define _WIN32_IE 0x0501
 
to
 
#define _WIN32_IE 0x0400
 
and the compile well ...
 

--------------------------------
I see...but I had other problem;
Can you mail your code to me ?
Thanks.
my email "zhanghao@newlandcomputer.com"

GeneralRe: How to install WTL in C++membernmtdhbk22 Jun '06 - 16:46 
sorry,When i create new project I have same error, I changed same way as you but it reported error
 
Ru ao phong suong tren gac tro...
GeneralRe: How to install WTL in C++memberCuBr1 Sep '06 - 11:41 
Try removing (or modifying) the following lines in stdatl.h:
 
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
#define _WIN32_IE 0x0501

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 1 May 2001
Article Copyright 2000 by Ben Burnett
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid