IExtendPropertySheet::CreatePropertyPages method (mmc.h)

Adds pages to a property sheet.

Syntax

HRESULT CreatePropertyPages(
  [in] LPPROPERTYSHEETCALLBACK lpProvider,
  [in] LONG_PTR                handle,
  [in] LPDATAOBJECT            lpIDataObject
);

Parameters

[in] lpProvider

A pointer to the IPropertySheetCallback interface.

[in] handle

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.

[in] lpIDataObject

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.

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

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header mmc.h

See also

Adding Property Pages and Wizard Pages

IExtendPropertySheet

IPropertySheetCallback

MMCFreeNotifyHandle