Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IPropertySheetCallback::AddPage method

The IPropertySheetCallback::AddPage method enables a snap-in to add a page to a property sheet.

Syntax


HRESULT AddPage(
  [in] HPROPSHEETPAGE hPage
);

Parameters

hPage [in]

A value that specifies the handle to the page to be added. The hPage parameter is a handle to a PROPSHEETPAGE structure created by the Windows API CreatePropertySheetPage.

Return value

This method can return one of these values.

S_OK

The page was successfully added.

S_FALSE

There are too many pages on this sheet. The maximum is 255.

E_UNEXPECTED

An unexpected error occurred.

E_POINTER

The parameter is NULL.

Remarks

The snap-in cannot call AddPage from within a property page handler because the property page is created and runs on a secondary thread. A snap-in cannot call an MMC interface from a different thread than the one in which the snap-in was created. The correct place to call AddPage is in the snap-in's implementation of the IExtendPropertySheet2::CreatePropertyPages method.

If a snap-in uses the IPropertySheetProvider interface directly, it can use AddPage to add the primary pages and then call IPropertySheetProvider::AddPrimaryPages (NULL, FALSE, NULL, [TRUE or FALSE]) so that the provider will add these pages to the property sheet. For more information about how to create your property pages in the snap-in's implementation of IExtendPropertySheet2::CreatePropertyPages, see IPropertySheetProvider::AddPrimaryPages.

Pages are added to the sheet in the order in which they are presented. The primary snap-in's pages are always added first.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Mmc.h

DLL

Mmcndmgr.dll

See also

IPropertySheetCallback

 

 

Show: