Hello I have a big problem with dialog. I construct the dialog then I use CPropertyPage

CameraSetup pCameraSetup = new CCameraSetup[MAX_CAMS];
UINT rgID[MAX_CAMS] = {IDS_CAMERA1, IDS_CAMERA2};
CPropertySheet dlgPropertySheet(AFX_IDS_APP_TITLE);
dlgPropertySheet.AddPage(&pCameraSetup[0]);
dlgPropertySheet.AddPage(&pCameraSetup[1]);
for (ULONG i = 1; i <= MAX_CAMS; i++)
{
pCameraSetup[i-1].Construct(rgID[i-1]);
}
dlgPropertySheet.DoModal();




definition of the CCameraSetup:


class CCameraSetup : public CPropertyPage;




By doing DoModal I receive always an Debug Assertion failed in dlgprop.cpp in line 201.

This is the section:


void CPropertyPage::PreProcessPageTemplate(PROPSHEETPAGE& psp, BOOL bWizard)
{
const DLGTEMPLATE* pTemplate;

if (psp.dwFlags & PSP_DLGINDIRECT)
{
pTemplate = psp.pResource;
}
else
{
HRSRC hResource = ::FindResource(psp.hInstance,
psp.pszTemplate, RT_DIALOG);
HGLOBAL hTemplate = LoadResource(psp.hInstance,
hResource);
pTemplate = (LPCDLGTEMPLATE)LockResource(hTemplate);
}

ASSERT(pTemplate != NULL); --->Error




This is happen only when I will give to my Tabs a name (in this case with Construct(..)).
Can anyone help me??

Thanks a lot!