Library:WTL
| Platforms | Platform:Windows |
|---|---|
| License | Microsoft Public License / open source |
| On this wiki | Facts · Code · Notes · Topics |
The Windows Template Library, a header-only C++ library on top of ATL for Win32 GUIs: it has no runtime DLL, so it is recognised by ATL window class RTTI names and by message-map functions rather than tables.
Identification
WTL (open source, formerly Microsoft Public License, hosted on SourceForge) is only templates: there is no DLL to import. An executable built with it has ATL's CWindowImpl/CDialogImpl instantiations (Library:ATL) with WTL layers such as CFrameWindowImpl, CMessageFilter, CIdleHandler, CUpdateUI, CAppModule (RTTI names containing WTL: .?AV?$CFrameWindowImpl@...@WTL@@, .?AVCAppModule@WTL@@).
Message handling
WTL uses the ATL macro style: BEGIN_MSG_MAP, MESSAGE_HANDLER, COMMAND_ID_HANDLER, NOTIFY_CODE_HANDLER, CHAIN_MSG_MAP, plus the MSG_WM_* macros of atlcrack.h which unpack lParam/wParam into a typed handler (for example MSG_WM_INITDIALOG(OnInitDialog)). All of these expand into a compiled ProcessWindowMessage function, see Library:ATL#Message maps; there is no AFX_MSGMAP-like data table to walk. The UI-update map (BEGIN_UPDATE_UI_MAP, UPDATE_ELEMENT) is a data table of _AtlUpdateUIMap entries {id, flags} (Unverified).
The main loop is CMessageLoop::Run with PreTranslateMessage and OnIdle calls; _Module or _AtlModule is the global CAppModule.
Evidence & references
- Unverified: this page is an outline from knowledge of WTL; no WTL source was read for it. Test on a WTL binary with RTTI.