Solved

Application error when closing down...

Posted on 2002-03-19
5
175 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

789 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