Discussion:
MFC and CPropertySheet versus Wiz97 sample
(too old to reply)
lallous
2004-12-30 10:34:04 UTC
Permalink
Hello

I was trying to add watermark/header support to my wizard that is initially
written using MFC's CPropertySheet and CPropertyPage.

I have copied the same flags as in the Wiz97 sample (which uses win32 APIs
rathers than MFC).


CMyPropertySheet::CMyPropertySheet(CWnd* pWndParent)
: CPropertySheet(IDS_PROPSHT_CAPTION, pWndParent)
{
m_Page1.m_psp.dwFlags |= PSP_DEFAULT | PSP_HIDEHEADER;

m_Page2.m_psp.dwFlags |= PSP_DEFAULT | PSP_USEHEADERTITLE |
PSP_USEHEADERSUBTITLE;
m_Page2.m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_TITLE1);
m_Page2.m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_SUBTITLE1);

m_Page3.m_psp.dwFlags |= PSP_DEFAULT | PSP_USEHEADERTITLE |
PSP_USEHEADERSUBTITLE;
m_Page3.m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_TITLE2);
m_Page3.m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_SUBTITLE2);

m_Page4.m_psp.dwFlags |= PSP_DEFAULT | PSP_HIDEHEADER;

SetWizardMode();

m_psh.dwFlags |= PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;

m_psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
m_psh.pszbmHeader = MAKEINTRESOURCE(IDB_BANNER);

AddPage(&m_Page1);
AddPage(&m_Page2);

AddPage(&m_Page3);
AddPage(&m_Page4);
}

Yes, I have the appropriate IDS_XXXX and IDB_XXXX in my project.

The problem is that the Watermark doesn't get displayed, and the
headersubtitle/headertitles are being shown but not with a white
background...

Isn't it possible to achieve same results as Wiz97 but through using MFC's
classes?

Regards,
Elias
Jeff Partch [MVP]
2004-12-30 12:42:47 UTC
Permalink
Post by lallous
Hello
I was trying to add watermark/header support to my wizard that is initially
written using MFC's CPropertySheet and CPropertyPage.
The problem is that the Watermark doesn't get displayed, and the
headersubtitle/headertitles are being shown but not with a white
background...
Isn't it possible to achieve same results as Wiz97 but through using MFC's
classes?
I think the MFC classes CPropertySheetEx and CPropertyPageEx exist to
provide this.
--
Jeff Partch [VC++ MVP]
l***@lgwm.org
2005-01-05 15:20:56 UTC
Permalink
Hello Jeff,

I added this at the end of the constructor and all worked fine:

m_psh.hInstance = AfxGetInstanceHandle();


I didn't know that one has to specify this, thinking that the wrapper
would take care of it!

--
Elias
Post by lallous
Post by lallous
Hello
I was trying to add watermark/header support to my wizard that is
initially
Post by lallous
written using MFC's CPropertySheet and CPropertyPage.
The problem is that the Watermark doesn't get displayed, and the
headersubtitle/headertitles are being shown but not with a white
background...
Isn't it possible to achieve same results as Wiz97 but through using MFC's
classes?
I think the MFC classes CPropertySheetEx and CPropertyPageEx exist to
provide this.
--
Jeff Partch [VC++ MVP]
Loading...