Setmsghandled and ismsghandled errors in wtl

Source: Internet
Author: User

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 ............

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.