Solved

Page Setup dialog customization

Posted on 1998-09-02
1
356 Views
Last Modified: 2013-11-20
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,pParentWnd)
{
 //{{AFX_DATA_INIT(SetupDlg)
  // NOTE: the ClassWizard will add member initialization here
 //}}AFX_DATA_INIT
 
 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?

Thanks
0
Comment
Question by:triv
1 Comment
 
LVL 1

Accepted Solution

by:
Bridge earned 50 total points
ID: 1321641
To override the custon dialogs you must provide a complete dialog resource and not just the new controls you need on a child dialog. To to this copy the current common dialog resource you want out of the commdlg.dll and put that into your resources.
( to copy the resource open the DLL in MSDEV and open as resource )
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question