System understands WIN32 API and MFC (ON)

Source: Internet
Author: User
Tags thread win32

The Win32 API is the programming interface that Microsoft's operating system Windows provides to developers, and it determines the capabilities of the Windows applications we develop. MFC is the class library provided by Microsoft for developers, and in a sense is the encapsulation of the Win32 API. This paper attempts to understand the Win32 API and MFC from a global perspective--and gives the conceptual model of both.

This article uses UML to describe the conceptual model. Win32 API is not object-oriented, I use object-oriented point of view to understand it, nothing more than to express its overall situation.

This article is a reference to MSDN, related books and some information on the web, thanks together.

A conceptual model of Win32 API

The Win32 API has 3 types of object: User Obj,gdi Obj,kernel obj. However, if the OS itself is not taken into account, there will be some problems, so I'm here to add "operation system is responsible for breaking the interrupt into a message."

1. User obj, GDI obj, kernel obj, System 4 relationships

Since the kernel obj section is responsible for connecting the other 3, we dive directly into the kernel obj section in the following figure.

As you can see from the diagram, there are 3 other classes of Object:kernel obj, user obj, and GDI obj that run in memory, in addition to the System Support Section, which is responsible for wrapping the interrupts into message. Each obj has a handle handle corresponding to it. Where GDI obj establishes the connection between the Windows application to be developed and the external output device, the file in kernel obj establishes the connection between memory and persistent storage devices. Specifically, the memory of the file from the hard drive, if this file is an executable, it will generate Module,module run is process,process can contain multiple thread, and thread running image ultimately from file. Thread is the most important of kernel obj, because Message Queuing is what thread has, and only thread can accept messages. Operations on GDI obj, Urser obj, and file also occur in thread. So the book says that process has at least one thread.

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.