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
Solved

Page Setup dialog customization

Posted on 1998-09-02
1
363 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 169
haveThree challenge 22 121
Problem to App 4 97
I could not set window to top 4 20
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 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