IExtendPropertySheet2::CreatePropertyPages method
The IExtendPropertySheet2::CreatePropertyPages method adds pages to a property sheet.
Syntax
HRESULT CreatePropertyPages(
[in] LPPROPERTYSHEETCALLBACK lpProvider,
[in] LONG_PTR handle,
[in] LPDATAOBJECT lpIDataObject
);
Parameters
lpProvider [in]
A pointer to the IPropertySheetCallback interface.handle [in]
A value that specifies the handle used to route the MMCN_PROPERTY_CHANGE notification message to the appropriate IComponent or IComponentData interface.For snap-ins that use the IPropertySheetProvider interface directly, MMC creates the handle when the snap-in calls IPropertySheetProvider::AddPrimaryPages and specifies its bCreateHandle to be TRUE.
lpIDataObject [in]
A pointer to the IDataObject interface on the object that contains context information about the scope or result item.
Return value
This method can return one of these values.
S_OK
The property sheet pages were successfully added.S_FALSE
No pages were added.E_UNEXPECTED
An unexpected error occurred.E_INVALIDARG
One or more parameters are invalid.
Remarks
The IPropertySheetCallback interface is passed to the snap-in during a call to this method. The lifetime of this interface is under the control of MMC. As such, the pointer lpIDataObject is valid only during the lifetime of the immediate call to this method. Caching the lpIDataObject pointer value outside of the callback is not recommended.
The handle specified by the handle parameter must be saved in the property page object to notify the parent of property changes using the API function MMCPropertyChangeNotify.
If the snap-in returns a success code (S_OK, S_FALSE) from CreatePropertyPages, then the snap-in must call MMCFreeNotifyHandle. If the snap-in returns an error code, then MMC immediately frees the handle. For more information about when MMCFreeNotifyHandle should be called, see MMCFreeNotifyHandle.
Requirements
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 |
Header |
Mmc.h |