Setmsghandled and ismsghandled errors in wtl
Jiangxi sci-tech fangsh 2010/8/26
When learning the basic category of the second wtl InterfaceProgramAn error occurs as follows:
Mainfrm. cpp
E: \ programming documentation \ wtl \ wtl_study_fangsh \ wtlclock \ mainfrm. H (37): Error c2065: 'setmsghandled': Undeclared identifier
E: \ programming documentation \ wtl \ wtl_study_fangsh \ wtlclock \ mainfrm. H (37): Error c2065: 'ismsghandled': Undeclared identifier
Generating code...
Compiling...
Wtlclock. cpp
E: \ programming documentation \ wtl \ wtl_study_fangsh \ wtlclock \ mainfrm. H (37): Error c2065: 'setmsghandled': Undeclared identifier
E: \ programming documentation \ wtl \ wtl_study_fangsh \ wtlclock \ mainfrm. H (37): Error c2065: 'ismsghandled': Undeclared identifier
Locate the error as follows:
Some Comments on the Internet have not been changed for a long time. Fortunately, a foreign website http://www.hydrogenaudio.org/forums/lofiversion/index.php/t78967.html found its problem.
Begin_msg_map (cmainframe)
......
End_msg_map ()
It should be
Begin_msg_map_ Ex(Cmainframe)
......
End_msg_map ()
MFCProgrammer'sWtlGuide-interface base classWtlPairMessage ingEnhancementSpeaking:
Restoring wparam and lparam data transmitted by Win32 APIs through messages is troublesome and error-prone. Unfortunately, ATL does not provide us with more help, we still need to restore the data from the message, except for the wm_command and wm_notify messages. However, the emergence of wtl has saved all of this!
The extended message ing macro of wtl is defined in atlcrack. h. (This name is derived from the "message decryptor" and is the same term as that used by a Windows X. h Macro .)Begin_msg_mapChangeBegin_msg_map_ex,_ ExTo decrypt the message.Code.
Another method is to add the two lines of code at the end of the stdafx. h file to solve this problem:
# UNDEF begin_msg_map
# Define begin_msg_map (x) begin_msg_map_ex (X)
I am so careless ............