CPropertyPage::Construct

void Construct( UINT nIDTemplate, UINT nIDCaption = 0 );

void Construct( LPCTSTR lpszTemplateName, UINT nIDCaption = 0 );

Parameters

nIDTemplate

ID of the template used for this page.

nIDCaption

ID of the name to be placed in the tab for this page. If 0, the name will be taken from the dialog template for this page.

lpszTemplateName

Contains a null-terminated string that is the name of a template resource.

Remarks

Call this member function to construct a CPropertyPage object. The object is displayed after all of the following conditions are met:

Call Construct if one of the other class constructors has not been called. The Construct member function is flexible because you can leave the parameter statement blank and then specify multiple parameters and construction at any point in your code.

You must use Construct when you work with arrays, and you must call Construct for each member of the array so that the data members are assigned proper values.

Example

// Declare a CPropertySheet object.
CPropertySheet sheet("Simple PropertySheet");

// Create three CPropertyPage objects whose template IDs are specified
// in rgID array, and add each page to the CPropertySheet object. 
CPropertyPage   pages[3];
UINT rgID[4] = {IDD_STYLE, IDD_COLOR, IDD_SHAPE};
for (int i = 0; i < 3; i++)    
{
   pages[i].Construct(rgID[i]);
   sheet.AddPage(&pages[i]);
}

// Display a modal CPropertySheet dialog.
sheet.DoModal();

CPropertyPage OverviewClass MembersHierarchy Chart

See Also   CPropertyPage::CPropertyPage, CPropertySheet::DoModal, CPropertySheet::AddPage