Click here to Skip to main content
15,888,908 members
Articles / Desktop Programming / WTL
Article

Introduction to WTL - Part 1

Rate me:
Please Sign up or sign in to vote.
3.50/5 (10 votes)
30 Apr 2001 408.7K   79   64
The 'what' and 'where do I get it' of WTL

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.

Image 1

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


Written By
Team Leader Farmer's Edge
Canada Canada
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.

Comments and Discussions

 
GeneralCListBox Pin
MarkCarl22-Sep-00 14:10
MarkCarl22-Sep-00 14:10 
GeneralRe: CListBox Pin
24-Jan-01 5:45
suss24-Jan-01 5:45 
GeneralRe: CListBox ( Damn html encode! ) Pin
24-Jan-01 5:48
suss24-Jan-01 5:48 
GeneralTrouble downloading WTL Pin
Manuel13-Sep-00 4:54
Manuel13-Sep-00 4:54 
GeneralRe: Trouble downloading WTL (solved) Pin
Petr Prikryl15-Jan-01 4:10
Petr Prikryl15-Jan-01 4:10 
GeneralGreat solution Pin
F Braem7-Feb-01 3:34
F Braem7-Feb-01 3:34 
GeneralRe: Trouble downloading WTL (solved) Pin
5-Mar-01 2:00
suss5-Mar-01 2:00 
GeneralRe: Trouble downloading WTL (solved) Pin
Petr Prikryl5-Mar-01 22:58
Petr Prikryl5-Mar-01 22:58 
(Thanks, Michael, for new information.)

Here is updated version of the WTLextract.bat
batch file for instalation of WTL from two plain cab
files. New version of the batch extracts also examples
and ATL/WTL wizard. If you have any suggestion, share it!

Enjoy,
Petr Wink | ;) Wink | ;)

file WTLextract.bat
-------------------------------------------------------------------
echo off
cls
set psdk=Oct2000
set scommon=893058
set swizard=39162
set log=extract.log

echo WTL instalation
echo ---------------
rem Petr Prikryl (prikrylp@skil.cz), March 2001

if exist psdk-common.48.cab goto OKcommon
echo Firstly, copy this batch to some working directory.
echo Get the following cabinet file (you can just copy the following line
echo to the Internet Explorer, or you can use some ftp client to do that):
echo .
echo . ftp://ftp.microsoft.com/developr/PlatformSDK/%psdk%/psdk-common.48.cab
echo .
echo The size of the cabinet for %psdk% is %scommon% bytes.
echo If you want to install also the WTL wizard, download also
echo .
echo . ftp://ftp.microsoft.com/developr/PlatformSDK/%psdk%/psdk-x86.48.cab
echo .
echo The size of the cabinet for %psdk% is %swizard% bytes.
echo Place the cabinet(s) to the same directory where this batch is and
echo run the batch again. It creates ./WTL subdirectory with extracted files.
goto END

:OKcommon
echo Extracting headers and readme...

if exist %log% del %log%

extract /L WTL/Include psdk-common.48.cab *.A1000D79* >>%log%
extract /L WTL psdk-common.48.cab *.1BACAA38* >>%log%

cd WTL\Include
rename AtlApp_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlApp.h
rename AtlCrack_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlCrack.h
rename AtlCtrls_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlCtrls.h
rename AtlCtrlw_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlCtrlw.h
rename AtlCtrlx_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlCtrlx.h
rename AtlDdx_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlDdx.h
rename AtlDlgs_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlDlgs.h
rename AtlFrame_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlFrame.h
rename AtlGdi_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlGdi.h
rename AtlMisc_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlMisc.h
rename AtlPrint_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlPrint.h
rename AtlRes_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlRes.h
rename AtlScrl_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlScrl.h
rename AtlSplit_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlSplit.h
rename AtlUser_h.A1000D79_C485_4CB3_8AB0_B6D38ED2B38C AtlUser.h

cd ..
rename ReadMe_Txt.1BACAA38_9B60_4B39_9854_B7F2382B1334 ReadMe.txt

cd ..

:EXexamples
rem Extract examples from the same cabinet.
echo Extracting the GuidGen example...

extract /L WTL/Examples/GuidGen psdk-common.48.cab *.755E56A7* >>%log%
extract /L WTL/Examples/GuidGen/Res psdk-common.48.cab *.59DE9FFA* >>%log%

cd WTL\Examples\GuidGen

rename AboutDlg_h.755E56A7_E652_46B4_A6D7_0CCF315D2624 AboutDlg.h
rename GuidGen_Cpp.755E56A7_E652_46B4_A6D7_0CCF315D2624 GuidGen.Cpp
rename GuidGen_Dsp.755E56A7_E652_46B4_A6D7_0CCF315D2624 GuidGen.Dsp
rename GuidGen_Dsw.755E56A7_E652_46B4_A6D7_0CCF315D2624 GuidGen.Dsw
rename GuidGen_Rc.755E56A7_E652_46B4_A6D7_0CCF315D2624 GuidGen.Rc
rename MainDlg_h.755E56A7_E652_46B4_A6D7_0CCF315D2624 MainDlg.h
rename Resource_h.755E56A7_E652_46B4_A6D7_0CCF315D2624 Resource.h
rename StdAtl_Cpp.755E56A7_E652_46B4_A6D7_0CCF315D2624 StdAtl.Cpp
rename StdAtl_h.755E56A7_E652_46B4_A6D7_0CCF315D2624 StdAtl.h

cd Res

rename GuidGen_Ico.59DE9FFA_8157_4709_B094_5F2969E49B32 GuidGen.Ico

cd ..\..\..\..


echo Extracting the MdiDocVw example...
extract /L WTL/Examples/MdiDocVw psdk-common.48.cab *.53855E45* >>%log%
extract /L WTL/Examples/MdiDocVw/Res psdk-common.48.cab *.D0BD03AE* >>%log%

cd WTL\Examples\MdiDocVw

rename Hello_Ico.53855E45_E9A1_4D6D_A016_C86B55004781 Hello.Ico
rename MainFrm_h.53855E45_E9A1_4D6D_A016_C86B55004781 MainFrm.h
rename MDI_Cpp.53855E45_E9A1_4D6D_A016_C86B55004781 MDI.Cpp
rename MDI_Dsp.53855E45_E9A1_4D6D_A016_C86B55004781 MDI.Dsp
rename MDI_Dsw.53855E45_E9A1_4D6D_A016_C86B55004781 MDI.Dsw
rename MDI_Ico.53855E45_E9A1_4D6D_A016_C86B55004781 MDI.Ico
rename MDI_Rc.53855E45_E9A1_4D6D_A016_C86B55004781 MDI.Rc
rename Resource_h.53855E45_E9A1_4D6D_A016_C86B55004781 Resource.h
rename StdAfx_Cpp.53855E45_E9A1_4D6D_A016_C86B55004781 StdAfx.Cpp
rename StdAfx_h.53855E45_E9A1_4D6D_A016_C86B55004781 StdAfx.h

cd Res

rename HelloDoc_Ico.D0BD03AE_627D_487E_8F51_77F78E270524 HelloDoc.Ico
rename Idr_Boun_Ico.D0BD03AE_627D_487E_8F51_77F78E270524 Idr_Boun.Ico
rename MDI_Ico.D0BD03AE_627D_487E_8F51_77F78E270524 MDI.Ico
rename MDI_Rc2.D0BD03AE_627D_487E_8F51_77F78E270524 MDI.Rc2
rename Toolbar_Bmp.D0BD03AE_627D_487E_8F51_77F78E270524 Toolbar.Bmp

cd ..\..\..\..


echo Extracting the MTPad example...
extract /L WTL/Examples/MTPad psdk-common.48.cab *.DF8CBE9B* >>%log%
extract /L WTL/Examples/MTPad/Res psdk-common.48.cab *.07DB2F17* >>%log%

cd WTL\Examples\MTPad

rename AboutDlg_h.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 AboutDlg.h
rename MainFrm_h.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 MainFrm.h
rename MTPad_Cpp.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 MTPad.Cpp
rename MTPad_Dsp.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 MTPad.Dsp
rename MTPad_Dsw.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 MTPad.Dsw
rename MTPad_h.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 MTPad.h
rename MTPad_Rc.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 MTPad.Rc
rename Resource_h.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 Resource.h
rename StdAtl_Cpp.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 StdAtl.Cpp
rename StdAtl_h.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 StdAtl.h
rename View_h.DF8CBE9B_82F3_4DCB_AC8E_F6DEA2C503F3 View.h

cd Res

rename MTPadDoc_Ico.07DB2F17_27FF_442C_98E1_6D2B292E9F49 MTPadDoc.Ico
rename MTPad_Ico.07DB2F17_27FF_442C_98E1_6D2B292E9F49 MTPad.Ico
rename printpre_bmp.07DB2F17_27FF_442C_98E1_6D2B292E9F49 printpre.bmp
rename Toolbar_Bmp.07DB2F17_27FF_442C_98E1_6D2B292E9F49 Toolbar.Bmp

cd ..\..\..\..


:EXwizard
rem Extract wizard if the cabinet was downloaded

if exist psdk-x86.48.cab goto OKwizard
echo 
echo WTL wizard cannot be extracted -- cabinet file not present.
echo To extract WTL wizard get the cabinet file:
echo .
echo . ftp://ftp.microsoft.com/developr/PlatformSDK/%psdk%/psdk-x86.48.cab
echo .
echo The size of the cabinet for %psdk% is %swizard% bytes.
echo Place the cabinet to the same directory where this batch is and
echo run this batch again.
echo .
goto END

:OKwizard
echo Extracting WTL wizard...
extract /L WTL/AppWiz psdk-x86.48.cab /E >>%log%

cd WTL\AppWiz

rename AtlApp60_Awx.5500ABCF_72E4_45D7_BE1E_CF3394B98733 AtlApp60.Awx

cd ..\..

:END
echo 
pause
set psdk=
set scommon=
set swizard=
-------------------------------------------------------------------
(end of file)


--
Petr Prikryl, SKIL s.r.o.
GeneralPoor Windows Programmers! Pin
fabio29-Aug-00 11:25
fabio29-Aug-00 11:25 
GeneralRe: Poor Windows Programmers! Pin
jolyon6-Oct-00 6:46
jolyon6-Oct-00 6:46 
GeneralRe: Poor Windows Programmers! Pin
jhalsey11-Oct-00 12:41
jhalsey11-Oct-00 12:41 
GeneralRe: Poor Windows Programmers! Pin
jhalsey11-Oct-00 12:42
jhalsey11-Oct-00 12:42 
GeneralRe: Poor Windows Programmers! Pin
jhalsey11-Oct-00 12:43
jhalsey11-Oct-00 12:43 
GeneralRe: Poor Windows Programmers! Pin
jolyon13-Oct-00 5:42
jolyon13-Oct-00 5:42 
GeneralRe: Poor Windows Programmers! Pin
Anonymous2-Nov-00 13:21
Anonymous2-Nov-00 13:21 
GeneralRe: Poor Windows Programmers! Pin
3-Nov-00 12:31
suss3-Nov-00 12:31 
GeneralRe: Poor Windows Programmers! Pin
1-Apr-01 7:55
suss1-Apr-01 7:55 
GeneralRe: Poor Windows Programmers! Pin
S van Leent8-Jan-02 8:27
S van Leent8-Jan-02 8:27 
Generalassert(++critique != convaincant | réaliste) Pin
24-Apr-01 8:19
suss24-Apr-01 8:19 
GeneralRe: Poor Windows Programmers! Pin
8-Oct-01 17:55
suss8-Oct-01 17:55 
GeneralRe: Poor Windows Programmers! Pin
Shannon McCoy15-Aug-02 23:27
Shannon McCoy15-Aug-02 23:27 
GeneralRe: Poor Windows Programmers! Pin
Bill Dickinson25-Feb-03 11:01
Bill Dickinson25-Feb-03 11:01 
GeneralWTL Download Pin
Franky Braem15-Jun-00 23:54
Franky Braem15-Jun-00 23:54 
GeneralRe: WTL Download Pin
takashi (in japan)27-Jul-00 17:54
susstakashi (in japan)27-Jul-00 17:54 
GeneralWTL support from MFC Pin
David Hubbard12-May-00 6:09
David Hubbard12-May-00 6:09 

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.