当前位置:网站首页>MFC document view framework (relationship between classes)
MFC document view framework (relationship between classes)
2022-07-04 10:30:00 【Big bear loves to work】
Document view mode
One 、 Create document view mode
- It will generate automatically 4 Classes also correspond to 4 Group files ( The header file 、cpp file )
- CTestApp class
- This is where the program starts
- This is the whole class of the whole software 、 Main thread class 、 Responsible for message circulation and user interaction
- CTestView class
- This is a view class
- It is mainly used to display some interface information , data 、 Image, etc
- CTestDoc class
- This is a document class
- Mainly used for dealing with documents , For example, reading data from disk , Belong to “ Background data ”
- CMainFrame class
- This is the main framework class
- Mainly a framework ” Stereotype “, All the buttons 、 label 、 Edit boxes and so on are essentially windows , These windows are displayed on the frame
- As shown in the figure below
Two 、 The way of data transmission between classes
- Universal
-AfxGetApp() You can get CWinApp Application class pointer
-AfxGetApp()->m_pMainWnd** Get frame window pointer ( That is, the main window pointer )
- APP class Get template pointer in
- CWinApp::GetFirstDocTemlatePostion()
- CWinApp::GetNextDocTemplate()
- file Doc Class Get information about other classes
- CDocument::GetFirstViewPosition()、CDocument::GetNextView() Traverse all views associated with the document
- CDocument::GetDocTemplate() Get the document template pointer
- CDocument::UpdateAllViews() Update all views
- View View class Get information about other classes in
- CView::GetDocument() Get the corresponding document pointer
- CView::GetParentFrame() Get frame window
- frame MainFrame class Get data of other classes in
- CFrameWnd::GetActiveView() Get the pointer of the currently active view
- CFrameWnd::GetActiveDocument() Get the document pointer of the currently active view
边栏推荐
猜你喜欢
Custom type: structure, enumeration, union
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
leetcode1-3
Software sharing: the best PDF document conversion tool and PDF Suite Enterprise version sharing | with sharing
PHP code audit 3 - system reload vulnerability
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
RHCE day 3
DCL statement of MySQL Foundation
Rhsca day 11 operation
[200 opencv routines] 218 Multi line italic text watermark
随机推荐
原生div具有编辑能力
Exercise 8-7 string sorting (20 points)
OSPF summary
For programmers, if it hurts the most...
Rhcsa day 9
Deep learning 500 questions
RHCE day 3
Exercise 9-4 finding books (20 points)
Lavel document reading notes -how to use @auth and @guest directives in lavel
Servlet基本原理与常见API方法的应用
Network disk installation
Knapsack problem and 0-1 knapsack problem
2021-08-10 character pointer
Occasional pit compiled by idea
From programmers to large-scale distributed architects, where are you (2)
Latex arranges single column table pictures in double column format articles
What is an excellent architect in my heart?
leetcode729. My schedule 1
If you don't know these four caching modes, dare you say you understand caching?
Two way process republication + routing policy