Something about the callback function

Source: Internet
Author: User

Of course, as for the detailed implementation of callback functions, you need to study them with great efforts. Here I just want to summarize:
1. The callback function is defined by the developer according to a certain prototype (each callback function must be designed according to this prototype)

For example:
------------------------------------------
Bool callback DialogProc (

HWND hwndDlg, // handle of dialog box
UINT uMsg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
------------------------------------------
Note:
The CALLBACK function must have the keyword CALLBACK.
The callback function must be a global or static function and cannot be defined as a member function of a specific class.

2. The callback function is not directly called and executed by the developer (only the system interface API function is used as the starting point)
3. The callback function is usually passed to the system API as a parameter, which calls
4. The callback function may be called once by the system API or cyclically multiple times (SortItem is self-called)

In the end, there is another mechanism in windows-message mechanism, which is also a good tool to provide solutions for many practical problems, this is further summarized.

& Nbs

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.