MMCPropPageCallback function (mmc.h)
The MMCPropPageCallback function is only required by Microsoft Foundation Classes (MFC)-based snap-ins. The function sets the correct module state during page creation.
Syntax
HRESULT MMCPropPageCallback(
void *vpsp
);
Parameters
vpsp
A pointer to the Microsoft Windows PROPSHEETPAGE structure. Be aware that by default, MFC installs its own callback in the pfnCallback member of the structure.
Return value
This callback function can return one of these values.
Remarks
This function should not be called by snap-ins that statically link MFC libraries. A call to this function by such a snap-in will not link correctly.
For each page derived from CPropertyPage, call MMCPropPageCallback with a pointer to the page's callback, following these guidelines:
- All pages for a particular property sheet must use the same callback pointer.
- If you replace MFC's callback with your own, your callback must call MFC's callback.
- You must call this function with each CPropertyPage derived class.
AFX_MANAGE_STATE(AfxGetStaticModuleState( ))
For an operating system call, MFC does this automatically. Because MMC's property sheet is not an MFC CPropertySheet, the operating system call due to the callback is in the wrong module state. As a result, you need to make sure that the module state is correctly set during the page creation. This is the purpose of MMCPropPageCallback. After the module state has been set, the only AFX_MANAGE_STATE calls that need to be made are those exposed by the COM interfaces implemented by the snap-in (for example IExtendPropertySheet2::CreatePropertyPages). To determine whether the application has the correct module state, look at CWinApp and note the application name.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | mmc.h |