Page Setup dialog customization
Posted on 1998-09-02
Environment: VC++ 6.0, NT 4.0
I am trying to customize the 'Page Setup' dialog box. All I want to do is to add a few controls to the
dialog box without changing any of the existing controls.
This is what I did:
--I created a dialog box with a group box and a button at the bottom. I then made this dialog box of type
'Child' with no border and checked the 'Clip siblings' and 'Visible' in the Styles options.
--I then added a class to my project using CDialog as my base class
--In the dialog header file, I changed the 'CDialog' string to 'CPageSetupDialog' also modifying the
--My constructor looks like this
SetupDlg::SetupDlg(DWORD dwFlags, CWnd *pParentWnd)
// NOTE: the ClassWizard will add member initialization here
m_psd.lpPageSetupTemplateName = MAKEINTRESOURCE(IDD_PAGESETUP_DIALOG); //My
dialog box with a group box and a button
m_psd.Flags |= PSD_ENABLEPAGESETUPTEMPLATE ;
I have a 'Page Setup..' menu option which should invoke the dialog. However, the doModal() returns 0
and no dialog shows up. However, if I remove the last two lines in the code above, the 'Page Setup'
dialog box is displayed but without my button.
What am I doing wrong?