Category: WTL

Windows Template Library related

Smart ATL/WTL combo box and list view classes to cast and optionally manage typed control item data

Inspired by the post on Yahoo’s WTL group (actually, I have been going to post on this topic for a couple of weeks already). Standard Windows controls (including common controls) that have multiple items (list box, combo box, list view, tree view etc.) have an option to attach user defined value of type DWORD_PTR (LPARAM)…

Read the full article

How to obtain call stack programmatically in ATL and WTL (actually, ATL only)

While debugging, obtaining call stack at a certain [problematic] point of execution, such as especially deadlock condition or on assert, is an invaluable help. Debugger shows it, however it is possible to get the call stack programmatically and even more: having program database along with the executable it is even possible to resolve symbols and…

Read the full article

WTL style notification message cracking macros for common control notifications

Windows Template Library contains atlcrack.h header file with macros to reinterpret window message parameters: split if required and cast to proper type. For instance, instead of: MESSAGE_HANDLER_EX(WM_SIZE, OnSize) … LRESULT OnSize(UINT, WPARAM wParam, LPARAM lParam) { UINT nType = (UINT) wParam; CSize Extent(LOWORD(lParam), HIWORD(lParam)); it allows to make things simpler and in a more reliable…

Read the full article