Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Page Setup dialog customization

Posted on 1998-09-02
1
Medium Priority
?
371 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Bridge earned 200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

650 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