Closing an application

This is a discussion on Closing an application within the C++ Programming forums, part of the General Programming Boards category; Does anyone know how to close an application programmatically (kinda like AfxAbort() but without the ugly error message)?...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    7

    Closing an application

    Does anyone know how to close an application programmatically (kinda like AfxAbort() but without the ugly error message)?

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,801
    By calling the exit function.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    7
    yes, that works, but it causes memory leaks when closing the app. I was so stupid!! All I had to do was call my CMainFrame's OnClose() function. Thanks for your help, though!!

  4. #4
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    That sounds suspiciously to me like an event handler, or something you would atexit(). Are these memory leaks anything more than you just not cleaning up your malloc'ed memory?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Application closing by default?
    By Blackroot in forum Windows Programming
    Replies: 2
    Last Post: 07-31-2008, 01:34 AM
  2. "Invalid pointer operation" when closing application
    By MiraX33 in forum Windows Programming
    Replies: 2
    Last Post: 10-05-2006, 10:35 PM
  3. Problem with closing my application
    By Frantic- in forum Windows Programming
    Replies: 2
    Last Post: 08-30-2005, 11:04 PM
  4. Closing the application window
    By Cojones893 in forum C++ Programming
    Replies: 4
    Last Post: 10-17-2004, 06:10 PM
  5. closing the Save_As dialog kills the application?!?
    By chanyees in forum Windows Programming
    Replies: 2
    Last Post: 05-02-2004, 07:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21