[This is preliminary documentation and subject to change.]
Sets the correct module state during page creation.
STDAPI MMCPropertyPageCallback
void * vpsp, // Pointer to PROPSHEET structure
);
For each page derived from CPropertyPage, call this function with a pointer to the page's callback, following these guidelines:
MFC must have correct module state set from exported functions or COM interfaces. This includes calls made from the operating system to the module. For exported functions or COM interfaces this is done with an AFX_MANAGE_STATE (AfxGetStaticModuleState). For the operating system call, MFC does this automatically. Since the property sheet is not an MFC CPropertySheet, the operating system call, due to the callback, is in the wrong module state. MFC will make changes in the future to use the module state contained in the CCmdTarget class, but until then, you hook the window create and make sure the module state is correctly set during the page creation, which is what the MMCPropPageCallback does. Once this is done, the only AFX_MANAGE_STATE calls that need to be made are those exposed by COM interfaces (IExtendPropertySheet::CreatePropertyPages). To determine whether the application has the correct module state, look at CWinApp and note the name.