Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner MFC...

Status
Not open for further replies.

Skute

Programmer
Jul 21, 2003
272
GB
Hi,

firstly i need a couple of good links for some beginner MFC tutorials.

secondly, id like to know the best method of quitting an application (when a user clicks a quit button, or exit from the menu etc)

cheers
 
use PostMessage with the WM_CLOSE message

tutorials can be found on MSDN and maybe CodeProject as well however i recommend books targeted at beginners. Starting C++ Windows programming is a long journey. There are many fundamental issues that good beginner books should/will cover.


-pete
 
im not necessarily a beginner, i know windows programming but never used mfc before. i know all about postmessage and sendmessage and the windows messages, but at the moment im using DestroyWindow().

thanks
 
>> secondly, id like to know the best method of quitting an
>> application (when a user clicks a quit button, or exit
>> from the menu etc)

To hook up a button or menu item to the framework close handling functionality bind the button or menu item to the pre-existing symbol ID_APP_EXIT

-pete
 
Also you can use
PostQuitMessage(NULL);
It is a usual practice for standalone applications which could have or not windows, but all of them them have message loops.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 

I recomment The Visual C++ 6.0 Bible. Takes you through everything from Dialog, SDI, and MDI applications. Covers menus, toolbars, status bars, etc, with examples to boot. You won't regret reading it.

Brother C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top