Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Application error when closing down...

Posted on 2002-03-19
5
Medium Priority
?
179 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 800 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

Technology Partners: 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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

636 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