Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Can't close my application Collapse All
Subject Author Date
John Kiernan Jun 22, 2006 - 1:01 PM

For some reason when I push the "X" on the title bar or the "File->Exit" menu, my application no longer exits.
The button associated with IDOK is the only way to close the app.

I’m a little confused since this I think this was working before and I don’t think I added any code that would affect this.
I don’t even attempt to handle any close messages. I did add a few more buttons to the main dialog but nothing else.
I can’t seem figure out what’s going on.

Thanks.

Technical Support Jun 23, 2006 - 10:55 AM

Please let us know more details about the problem. We guess you have a dialog-based application and only the OK button should close the dialog. But we are not sure if our guess is correct. We need to know exactly how the "X"-button in the caption, File|Exit menu and the OK button somewhere should work and what the problem is. Please also tell us which version of Prof-UIS and which Visual C++ you are using.

John Kiernan Jun 23, 2006 - 11:32 AM

Sorry for the lack of details.... Let me try to explain this a little better.
It’s a dialoag based app with a system title bar and menu. (The system title bar has the standard MINIMIZE, MAXIMIZE and CLOSE (X) )
On the menu there is a standard ’Exit’ option that has the windows ID: ID_APP_EXIT

I’ve never had any message handlers for either of these... They just worked. i.e. if you open a dialog box and click the ’X’ on the title bar it closes.
and of course I have the "OK" button that is a CExtButton which has the standard ID: IDOK....
The OK button does close the app.

I added another button to the control and now The OK button still closes the app, nothing else does.
I really don’t know what I did, as these _were_ working before. I’m not even sure how I could duplicate this problem.

I’m using Prof-UIS 2.54 and VS2005

Thanks for any suggestions.



Technical Support Jun 24, 2006 - 1:00 PM

The event when the dialog window is closed can be intercepted in the CDialog::OnOK() and CDialog::OnCancel() methods. CDialog::OnOK()is invoked when the IDOK button is clicked, the Enter key is pressed and the IDOK button is the default button in the dialog. CDialog::OnCancel()is invoked when the IDCANCEL button is clicked, the "X" button in the caption is clicked or Alt+F4 or ESC keys are pressed. If both of these methods in your dialog window do not invoke the parent class methods, then you will really be unable to close the dialog. You can send us the source code of your dialog class so we can check it.