closing a dialog resource derived from CPrintDialog ?

I created a modified CPrintDialog that I call CMyPrinterDialog.  I then 
added a Apply button and hid most of the stuff except what I need to 
select a printer which is what I was after.  It works fine and when I 
click on the OK button, it does what I want, but I have one problem. 
When I click on cancel or the close 'x', the dialog closes and then pops 
up again so that you have to click twice actually before it closes 
completely.  Any idea what I might be doing wrong?

   Z.K.
0
nospam7515 (2084)
9/25/2006 7:54:24 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
403 Views

Similar Articles

[PageSpeed] 23

Reply:

Similar Artilces:

Newbie MFC question: child dialog becomes unclickable!?!
Hi, I'm programmin a visual application using MDI and MFC. The standard document is a real time capture from the camera. I want to create a dialog box staying inside of the mainframe window so i think it must be a child (not popup). but if I set the style to child the dialog becomes unclickable. I'm a newbie to MFC and VC++. Can anybody helps me please? thanks violink Are you using the DoModal method to create and show the dialog? If you're not then I'm not sure what the problem is and you might want to post the code that you're using to show the dialog. If you are usi...

Outlook Opens Closes need 2 reboots
When I reboot and open Outlook opens, I see the Inbox, and it immediatley closes. It then needs 2 reboots to start and stay open. I'm running Windows XP and Outlook 2000 (from Office 2000). Can anyone help???? ...

flashing dialog
Hi, I have a problem with a CDialog derived class. Every time I repaint into it in method OnPaint(), I use a CDC in memory to make my BitBlt and finally I make the BitBlt to the CPaintDC of the screen. The problem is when I call a method to update some lines on the screen and I need to call the Invalidate() method. I see the dialog flashing and I don't understand why, even if I am using this trick to draw first in memory and finally on the screen (double buffering?). This is an example of the OnPaint method: void CMyWindow::OnPaint() { CPaintDC dc(this); // TODO: Add your message hand...

Auto Resize Dialog
Friends, I am new to MFC. I want to how to resize the dialog automatically(differnt monitor size) when i run on different pc. Udhay You can resize the window in oninitdialog by using any resizing function like SetWindowPos. If you want to cover the whole screen a better way is ShowWindow(SW_MAXIMIZE) Emmanuel On Jul 2, 9:12 am, Udhay <udhyakum...@gmail.com> wrote: > Friends, > > I am new to MFC. I want to how to resize the dialog > automatically(differnt monitor size) when i run on different pc. > > Udhay On Jul 2, 3:12 am, Udhay <udhyakum...@gmail.com> w...

Default Alternate resource rate
Hello, For a particular project I would like Project to use an alternate rate table for a resource. Instead of editing the Cost Rate Table for each task can I somehow set a default for the whole project? Thanks, Mike Einhorn In article <59C4A51A-0B3E-4F7F-80FB-540FDFD70766@microsoft.com>, Mike Einhorn <MikeEinhorn@discussions.microsoft.com> wrote: > Hello, > > For a particular project I would like Project to use an alternate rate table > for a resource. Instead of editing the Cost Rate Table for each task can I > somehow set a default f...

looking for a resource planning template
Need a resource planning template for college course I am undertaking ...

Close button on Crystal Reports page
Hello Community When an ASP.Net application produces an embedded Crystal Report, if the Crystal Report is in fullscreen mode is there a way to put an Close button on the Crystal Report so that when the button is clicked the Crystal Report will close and the application screen behind it that called it can be visible again? Thanks Jeff -- JB ...

Report that print quotes closed or quote status
How can I print a report that display the quotes status? I mean all quotes open (no invoices done) or quotes closed (quotes converted invoice) You can edit the quote summary report and add Begin Column FieldName = "[Order].Closed" DrillDownFieldName = "" DrillDownReportName = "" Title = "Closed" VBDataType = vbBoolean Formula = "" ColHidden = False ColNotDisplayable = False FilterDisabled = False ColWidth = 1005 GroupMethod = groupmethodNone ColFormat = "" ColAlignment = flexAlignCenterCente...

Change events for all controls on a dialog
Is it possible to have a single method that handles all change notifications to text boxes on a dialog? I want to enable the OK button if any text box changes. The application I am porting to MFC has the following code in its dialog handling procedure: switch ( uMessage ) { case WM_COMMAND: // Enable the OK button only when changes are made if ( GET_WM_COMMAND_CMD( wparam, lparam ) == EN_CHANGE ) { Button_Enable( GetDlgItem( hdlg, IDOK ), TRUE ); break; } switch ( GET_WM_COMMAND_ID( wparam, lparam ) ) { // handle other commands } break; .... It seems that in ...

Questions about MFC Dialog Box
Right now I am coding a programming that will scan a computer for mp3s and display where they are located in a log or text file. I have built the GUI using VS C++ MFC and things are looking good, but I wanted to add a couple of features that I feel I am a little shaky on, so I figured I would try my luck with you guys! Basically I want to add 2 things: When the user clicks the scan button I would like a popup messagebox stating the the program is infact scanning. The other function would be a pop up that would come about after the scan has ceased. My source code for the button is fairly basic...

unwanted dialog box
hi everybody...... if i have a query (i have one in a macro), everytime i open the file the first thing that shows up is a dialog box asking me if i want t "activate auto atualization" (i dunno the exact words due to my exce portuguese version)... well, i dont want this dialog box to show up, i tried every singl button in excel options to make it go away, but i cant find solution.... anyone can help me -- redf1r ----------------------------------------------------------------------- redf1re's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3125 View t...

dialog within a dialog
I was just wondering if there is a way to have a dialog within a dialog. I want something like a property sheet but more flexible. My hex editor has like property sheets within a dialog box. Check out the first couple of screen shots at http://www.softcircuits.com/cygnus/find.htm. Don't know that I can describe, right here, the entire proceeedure of how I did it. I know I plopped a Tab control onto my dialog template. I created dialog templates with content for each of the tabs (child style). And, in my main dialog's OnInitDialog() method, I created the child dialogs and then ...

Need program to ask me to save changes when closing
Hi My wife has excel 2003 and she at times closes the program and the file she is working on will close without saving the changes. My machine always asks me if I want to save the changes made. I can not find out how to enable this, please help. My auto save is also not working any ideas. Thank you. Hi see your post in Excel.misc -- Regards Frank Kabel Frankfurt, Germany yar wrote: > Hi > > My wife has excel 2003 and she at times closes the program and the > file she is working on will close without saving the changes. > > My machine always asks me if I want to ...

change dialog title on runtime
Hi All, is anyone know, how can i change mfc dialog during the runtime (not the resource file on offline) Thanks SetWindowText -- Vladimir "Gabi" <Gabi@discussions.microsoft.com> wrote in message news:92AD60C3-4510-4745-A05C-DC06A9D8E66C@microsoft.com... > Hi All, > is anyone know, how can i change mfc dialog during the runtime (not the > resource file on offline) > > Thanks Hi, thanks for your answer but i might not explain my self well. i want to change only the tiltle of my dialog, nothing more . Thanks "Scherbina Vladimir" wrote: >...

Modal dialog as thread
The following 3 step procedure was taken form CodeGuru article named Convert modal dialogs to modeless by Jon S. Kyle It works greate but I can't figure out how to modify controls text on the dialog box while its already diplayed. Can someone advise please? Rami 1. In your header file define a CWinThread-derived class... class CDialogThread : public CWinThread { DECLARE_DYNCREATE(CDialogThread) CDialogThread() {}; virtual BOOL InitInstance(); }; 2. Put this in your implementation file (where CSomeDialog is a conventional dialog class defined the usual way). IMPLEMENT_DYNCREATE(CD...

Localization
Hi, I have a few dialogs, icons, bitmaps, strings that I've localized in the following way: I've created a separate resource only dll which has a separate RC file for each language. This project also has a different build configuration for each language. So that in that configuration only that dll will build and the resources pane in the project properties will be set to the proper culture for each build configuration. I am loading that dll from a COM c++ dll in the following way: m_hDll = ::LoadLibraryEx(filename.c_str(),NULL,LOAD_LIBRARY_AS_DATAFILE); ATLASSERT(m_hDll != NULL);...

Dialog box problem with enabling controls
I set the Enabled property of controls in a dialog box in Form_Load. I am encountering strange behavior at times where, with a certain Button.Enabled set to True, it still displays disabled. In other places where this form is shown in my program, it works fine. But only in this one instance, it does not display the controls properly. When I add message boxes to display certain variables' values, the values look correct and then the form displays properly (the button is enabled as I expect and wish). If I set breakpoints and define watched variables and then run the program...

problem in SDI when I close application
Hi, I have made SDI application . But the program crashes in CDocument destructor when I close the application . In this statement: m_pDocTemplate->RemoveDocument(this); I havent changed generated code of document and view class of SDI application. I am unable to understand why it happens. Please help. Thanks, Dhaval Define "crash". There is no such thing. There are exceptions thrown due to access faults or similar errors, and they occur in some specific place in the code; there are assertion failures, which always indicate a line of code. Your description doe...

Add new resource / RBS
Hi, I have a client requirement to add new resource using PWA only. With the following requirement, I'm not sure if I should add new resources under the RBS look up table or just add them using the Manage Users/Groups option. Level 1 - Department Level 2 - Group (with security permission) Level 3 - Users/Resources. The requirement is that resources under one department can only view projects under that department, except for those in the Admin group can view projects across departments. Also another requirement is that if I select a department (level 1) a...

New to Microsoft RMS
Hello, can someone please tell me how to close out register for the end of day? I am opening in a week and I had some friends come to my store and they bought some stuff using their credit card. When I closed my register, I entered $0 for the cash transactions since I had no cash transactions but for the Amex line, was I suppose to enter in my total sales in credit cards since my friends used Amex? I thought that information was suppose to be populated automatically by the software since the credit cards was processed by the software. Reason why I ask is because I am showing a shortage ...

Custom PageSetup dialog & help
I have a custom PageSetupDialog - done by following steps recommended by MSDN. I have a custom dialog resource built by adding a few fields to the standard page setup dialog dialog resource, and have used the PSD_ENABLEPAGESETUPTEMPLATE flag to get my dialog. It all works as expected. My application has help files setup and I have handlers for the various help messages (ID_HELP, ID_HELP_INDEX, ID_CONTEXT_HELP etc.). When the application is running and you are at the custom page setup dialog and press the F1 key - a context help is displayed for all the fields that the standard Page setup...

Resource Scheduling #5
I am running Exchange 2003, with clients using Outlook 2003. I am trying to create a resource but keep getting the same error. After I create the new mailbox, I log onto the mailbox to configure it. When I click on "resource scheduling" it gives me the follwo error message: "This folder cannot be opened because there is a configuration problem on the server." Is there a setting i missed setting up the mailbox? What are you using to set up the resource scheduling? Outlook? If so, stop doing that, and download the Auto accept agent. It's free from Microsof...

Positioning Controls on Dialog
Hi, I'm trying to position a bitmapbutton on a dialog. But doing it in the resource editor, i can't get it exactly where i want (always a pixel or 2 out). Is there a way at runtime to position controls where you want them? Hamish "Hamish Dean" <h.dean@xtra.co.nz> wrote in news:rlphc.1157$_s.37385 @news.xtra.co.nz: > Hi, > > I'm trying to position a bitmapbutton on a dialog. But doing it in the > resource editor, i can't get it exactly where i want (always a pixel or 2 > out). Is there a way at runtime to position controls where you want the...

Size Dialog independant screen
Hello, I want my CDialog would have the same size on any screen resolution. I have developped my dialog on 1152*864, I don't want my dialog would be out the screen workarea if the screen resolution is 800*600. How can I do that ? Thierry I did a re-sizing dialog recently for a WebCam app. In my case, when the user selects a different video resolution the dialog re-sizes to accomodate. The same technique would work for your case, just get the screen size and use the result to re-size the dialog as follows (this also shows how to move controls around to keep them visible, but it doesn&...

Closing Outlook from command line
Is there a way to close Outlook from a command line? I need to have it closed before I do my daily backup on a remote machine. Outlook runs on this machine to archive all the emails managed through Exchange. Thanks Steve Hi Steve, you could try our freeware addin "QuitOutlook": With QuitOutlook you can shut down Outlook at a particular time. To start QuitOutlook you only need to add the script into a scheduled task of Windows. Then you are able to backup your Outlook data file (*.pst file) easily and uncomplicated Download on this site: http://www.publicshareware.com/pu...