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.