Click to See Complete Forum and Search --> : Terminating an application


Souf
June 17th, 2002, 01:48 PM
Hello,

I'm currently developping an application for PocketPC 2000, using MFC. It's a single document type.

I have 2 problems:

- I don't know how to end this application.
- How can you get rid of the "new" button, in the bottom left corner of the screen?

Could someone help me?

kind regards,

Souf

alanr
June 17th, 2002, 02:09 PM
use

DestroyWindow();

to kill a view or app.....

Souf
June 17th, 2002, 02:54 PM
thanks!

UltraTrunks
July 19th, 2002, 12:22 PM
How about exit(), that works well

stober
July 20th, 2002, 12:15 AM
You terminate a PocketPC MFC application just like any other MFC application for desktop -- PostQuitMessage(0), or PostMessage(WM_QUIT,0,0)

Normally you will have either a menu item such as File | Exit, or maybe an Ok and Cancel button. If you use the menu item, create an event handler for the item, then call PostQuiteMessage(0)

If you have an Ok and/or Cancel button in a CDialog-derived class, create event handlers for them that look something like this:

void MyView::OnOK()
{
CDialog::OnOK();
}


void MyView::OnCancel()
{
CDialog::OnCancel();
}

The exit() function does not allow MFC to do any cleanup, so its use is discouraged. You may introduce some memory leaks with exit() function.