次の方法で共有


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

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

See also

IExtendPropertySheet2

IPropertySheetCallback

MMCFreeNotifyHandle

Adding Property Pages and Wizard Pages