Chapter Summary

 < Free Open Study > 



The ATL framework provides a number of helpful templates that can be used to create main windows as well as interactive dialog boxes. The core class is CWindow, which wraps an underlying HWND and defines a large number of methods used to call API functions on your behalf. As it turns out, most of the remaining ATL windowing templates use CWindow as a parameter and therefore can leverage its functionality.

CWindowImpl<> and the MSG_MAP structure are used to hide the details of creating and registering your windows class, and assemble your WndProc. As we have seen, BEGIN_MSG_MAP expands to implement ProcessWindowMessage() which is (in essence) the gigantic switch statement Win32 developers know and love. A message map is populated using a variety of additional macros, with MESSAGE_HANDLER being the most common for a typical main window.

CSimpleDialog<>, CDialogImpl<>, and CAxDialogImpl<> each provide a different level of support for a Window's dialog box. CSimpleDialog<> displays a modal dialog with no support for user input. CDialogImpl<> derived classes provide user interaction, but offer no support for ActiveX controls. Finally, CAxDialogImpl<> gives you some additional support needed to build a dialog box hosting an ActiveX control.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net