Stingray® Foundation : Chapter 12 Developing Applications : Initializer Classes
Initializer Classes
SFL includes four initializer classes to use when instantiating instances of the CApp and CMTIApp classes. These classes are named CNoopInitializer, -CComInitializer, COleInitializer, and CCommonControlsInitializer. All four classes follow the same form; they expose two static functions: Init() and Term().
CNoopInitializer: Init() and Term() are essentially place holders, doing nothing within their implementations.
CComInitializer: CComInitializer takes two parameters when being instantiated—a base class (defaulting to CNoopInitializer) and a DWORD representing the COM threading model to use. CComInitializer::Init() calls CoInitializeEx() for the application, while CComInitializer::Term() calls CoUninitialize() for the application.
COleInitializer: COleInitializer::Init() calls OleInitialize() for the application, and CComInitializer::Term() calls OleUninitialize() for the application.
CCommonControlsInitializer: CCommonControlsInitializer takes two parameters when being instantiated—a base class (defaulting to CNoopInitializer) and a DWORD instructing the initializer how to call InitCommonControlsEx(). CComInitializer::Init() calls InitCommonControlsEx() for the application. CCommonControlsInitializer::Term() simply calls the base initializer’s Term() function.
With the application classes out of the way, take a look at how SFL’s window classes work.