Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Events and messages in mfc

Tags:

mfc

I am a bit confused about the difference between events and messages in mfc. Are they the same?

like image 886
Neal Avatar asked Dec 03 '22 15:12

Neal


1 Answers

Since you specifically ask about MFC, I assume you mean the event handlers and message handlers that you can define in the properties windows of a MFC class.

Under "events" you can define:

  • Handlers for WM_COMMAND windows messages.
  • MFC ON_UPDATE_COMMAND_UI handlers.
  • Handlers for child windows notification messages like ON_BN_CLICKED for handling of a button click in a dialog.

Under "messages" you can define message handlers for other Windows messages.

See also some explanation in msdn

In Win32 terms, both the events handlers and and message handlers, are in fact message handlers.

The other answers explain the difference between Windows events (unrelated to the MFC "events" described above), and Windows messages (correspond to both "events" and "messages" described above).

If you think that this is a bit confusing, I completely agree...

like image 167
Dani van der Meer Avatar answered Dec 31 '22 02:12

Dani van der Meer