Multiple choice technology programming languages

The DECLARE_MESSAGE_MAP macro should be provided at

  1. The beginning of the class definition.

  2. The end of the class definition.

  3. Anywhere in the class definition.

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

DECLARE_MESSAGE_MAP must be the last declaration in a class definition, appearing just before the closing brace. This macro declares the message map member variables and methods used by MFC's message routing system. Placing it anywhere else violates MFC conventions and will cause compilation errors.