1024programmer Blog Learning MFC (1)_Create function: void handle(); Implement the following functions in the function: variable infla_tyt2222008’s blog in the namespace mfc

Learning MFC (1)_Create function: void handle(); Implement the following functions in the function: variable infla_tyt2222008’s blog in the namespace mfc

class=”htmledit_views”>

C++ and C develop windows Application Difference

CLanguage:

Use a window handle HWND to complete various operations on the window (WND is windows internal private structure)

C++:

Use CWnd

Windows window and the difference between CWnd

CWnd is created by the constructor;

Windows window by <span lang="EN-US" of CWnd >Create function creation

CWnd class

Operate a HWND type data member: m_hWnd.

The difference between handle and pointer

The pointer corresponds to the address of a data in the memory, The pointer can modify the data freely

The handle cannot directly operate it, but calls the correspondingAPI by Function to operate.

Handle mapping mechanism (internal implementation mechanism)

MFC uses a CHandleMap to place the window handleMaps to C++window object;

(Question: Is this CHandleMap only one singleton class? Or create a MFC class creates a CHandleMap?)

This part is not very clear.

MFC and threads

MFC specifies,

1. Non-MFC threads cannot create and access MFC object.

(Question: What is MFC thread? How to create it?)

Answer: Only objects created by CWinThread can access MFC thread objects and using MFC objects.

(Question: Where is this CWinThread sacred?)

I feel that CWinThread is the class responsible for creating threads in c++.

2. A thread can only access MFC objects created by itself;

Module Creation of thread state

It is done in the constructor of CWinApp.

MFC application will automatically generate a theApp, than WinMain was created earlier.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/learning-mfc-1_create-function-void-handle-implement-the-following-functions-in-the-function-variable-infla_tyt2222008s-blog-in-the-namespace-mfc/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

The latest and most comprehensive programming knowledge, all in 1024programmer.com

© 2023 1024programmer - Encyclopedia of Programming Field
Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

首页
微信
电话
搜索