What is the Windows Template Library you ask?
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.
CPoint
, CRect
, CSize
, CString
, etc. All this but no documentation! Oh well, we're all professionals and can read code, so for now that will have to suffice.
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).
Click here to download the WTL source files.
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.
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.
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 |
atlprint.h | Printing and print preview |
atlres.h | Standard resource Ids |
atlscrl.h | Scrollable windows |
atlsplit.h | Splitter windows |
atluser.h | Menu class |
Directory | Description |
MTPad | Multithreaded notepad sample |
MDIDocVw | ATL version of the MDI sample |
GuidGen | ATL version of the GuidGen sample |
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.
转自:http://www.codeproject.com/Articles/498/Introduction-to-WTL-Part-1