triv
asked on
Page Setup dialog customization
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
constructor function.
--My constructor looks like this
SetupDlg::SetupDlg(DWORD dwFlags, CWnd *pParentWnd)
: CPageSetupDialog(dwFlags,p ParentWnd)
{
//{{AFX_DATA_INIT(SetupDlg )
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_psd.lpPageSetupTemplateN ame = MAKEINTRESOURCE(IDD_PAGESE TUP_DIALOG ); //My
dialog box with a group box and a button
m_psd.Flags |= PSD_ENABLEPAGESETUPTEMPLAT E ;
}
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?
Thanks
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
constructor function.
--My constructor looks like this
SetupDlg::SetupDlg(DWORD dwFlags, CWnd *pParentWnd)
: CPageSetupDialog(dwFlags,p
{
//{{AFX_DATA_INIT(SetupDlg
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_psd.lpPageSetupTemplateN
dialog box with a group box and a button
m_psd.Flags |= PSD_ENABLEPAGESETUPTEMPLAT
}
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?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.