System understands WIN32 API and MFC (bottom)

Source: Internet
Author: User
Tags win32

Second, the conceptual model of MFC

We have studied the "domain model" of the WIN32 API, and have a more comprehensive understanding of it. Next, we focus on the research on the app framework for the study of the MFC conceptual model.

The message response/delivery mechanism in the app framework is the most important. The hook mechanism is closely related to the message response/transfer mechanism, and the latter is based on the former.

1. Hook mechanism

Perhaps some programmers only know the hook mechanism can be written very "cow" application, who do not know MFC itself is relying on the hook mechanism.

As you can see from the diagram, each hook has a pointer queue, each pointing to a hookproc function called the hookproc that will be executed at the right time by the OS call. Hooks are different types of hooks, but the type of hook determines when it is executed by the OS call. Tip, you can look at the Subscribe-Publish design pattern to help you understand.

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.