Solved

Application error when closing down...

Posted on 2002-03-19
5
177 Views
Last Modified: 2013-11-20
When I try to close my app by running

void CMainFrame::QuitApp()
{
     SendMessage (WM_COMMAND, ID_APP_EXIT);
}

I get an APP Error type the memory could not be read at location 0x0000a0.

Can anybody help me get rid of this error. Should I send another message or what???

Thanks for your help.

TOM
0
Comment
Question by:tomschoem
[X]
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
5 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 6880074
Try SendMessage(WM_CLOSE)

Good Luck,
Steve
0
 
LVL 32

Expert Comment

by:jhance
ID: 6880180
One sure-fire way of causing this error is to send a message to a window that is already gone.  Are you SURE that this window is still open when this function gets called?
0
 
LVL 1

Expert Comment

by:kirthir
ID: 6880428
The same SendMessage command worked fine for me.
By the way what is "QuitApp()", Is it a user function or windows handler?

Also, u can change the code as follows to get the required effect.
void CMainFrame::QuitApp()
 {
PostQuitMessage(0)
 }
0
 
LVL 1

Accepted Solution

by:
kirthir earned 200 total points
ID: 6880435
This is really a clean way of achieving it

void CMainFrame::QuitApp()
{
    PostQuitMessage(0)
}
0
 

Author Comment

by:tomschoem
ID: 6882116
Cheers that will do!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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