Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with CPropertySheet::Create()

Status
Not open for further replies.

dds82

Programmer
Jun 5, 2002
251
US
I have a CPropertySheet-derived class in wizard mode. When I display it using DoModal(), everything works fine. However, when I try to use Create() instead, the wizard pages don't display properly. Can anybody help?

Thanks.
 
I should mention that I have the same problem even when the sheet isn't in wizard mode.
 
You have probably wrong Control IDs (there are in *.rc- File).
Then You can have wrong Property Pages in Your sheet.
If all that is ok, them You have probably wrong overrided any functions in PropertySheet.
A right sample:

class CPropertySheetEng : public CPropertySheet
{
public:
CPropertySheetEng();
CPropertySheetEng(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CPropertySheetEng(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
protected:
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
DECLARE_MESSAGE_MAP()
};

// CPropertySheetEng - to have Cancel button for all languages
CPropertySheetEng::CPropertySheetEng()
: CPropertySheet()
{

}

CPropertySheetEng::CPropertySheetEng(UINT nIDCaption, CWnd* pParentWnd,
UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{

}

CPropertySheetEng::CPropertySheetEng(LPCTSTR pszCaption, CWnd* pParentWnd,
UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{

}

BEGIN_MESSAGE_MAP(CPropertySheetEng, CPropertySheet)
ON_WM_SHOWWINDOW()
END_MESSAGE_MAP()

void CPropertySheetEng::OnShowWindow(BOOL bShow, UINT nStatus)
{
CPropertySheet::OnShowWindow(bShow, nStatus);
if(!bShow)
return;
GetDlgItem( IDCANCEL)->SetWindowText("Cancel");
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top