API for Dialog Styly Menu |File|Exit... 
Author Message
 API for Dialog Styly Menu |File|Exit...

What is the best API / MFC function for a dialog style based app's menu ->
File -> Exit

Would OnOK(); be enough or should I worry about memory leaks and stuff like
that.

Thank you

Newbie2002



Sat, 24 Jul 2004 06:11:26 GMT  
 API for Dialog Styly Menu |File|Exit...

Quote:

> What is the best API / MFC function for a dialog style based app's menu ->
> File -> Exit

> Would OnOK(); be enough or should I worry about memory leaks and stuff like
> that.

> Thank you

> Newbie2002

OnOK() is the correct way to exit from an MFC dialog-based app.  Before
or in OnOK() you should close anything you have open and 'delete'
anything you allocated with 'new'.
--
Scott McPhillips [VC++ MVP]


Sat, 24 Jul 2004 09:01:30 GMT  
 API for Dialog Styly Menu |File|Exit...
So if i didn't use the word new in my app, I dont need to worry about memory
leaks and the nasties like that?

Regards

Newbie2002


Quote:

> > What is the best API / MFC function for a dialog style based app's
menu ->
> > File -> Exit

> > Would OnOK(); be enough or should I worry about memory leaks and stuff
like
> > that.

> > Thank you

> > Newbie2002

> OnOK() is the correct way to exit from an MFC dialog-based app.  Before
> or in OnOK() you should close anything you have open and 'delete'
> anything you allocated with 'new'.
> --
> Scott McPhillips [VC++ MVP]



Sat, 24 Jul 2004 18:49:51 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. exit(1), exit(2), exit(3) ....???

2. Explorer file context menu in dialog.

3. Add File menu to dialog box?

4. Intercepting context menu in File Open dialog

5. Force exit from context menu

6. Adding menu item to dialog menu

7. Cannot gray out menu item for a dialog menu

8. Greying menu entries in dialog menu

9. Enabling/Disabling Menu items for a menu on a dialog application

10. Inserting menu items into a dialog's system menu

11. File menu options get disabled when OLE servers merged menu is selected

12. ?? activate menu via API calls

 

 
Powered by phpBB® Forum Software