Solved

Application error when closing down...

Posted on 2002-03-19
5
172 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
Comment Utility
Try SendMessage(WM_CLOSE)

Good Luck,
Steve
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
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
Comment Utility
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
Comment Utility
This is really a clean way of achieving it

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

Author Comment

by:tomschoem
Comment Utility
Cheers that will do!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now