当前位置:网站首页>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
边栏推荐
- DCL statement of MySQL Foundation
- uniapp 处理过去时间对比现在时间的时间差 如刚刚、几分钟前,几小时前,几个月前
- 有老师知道 继承RichSourceFunction自定义读mysql怎么做增量吗?
- 2. Data type
- From programmers to large-scale distributed architects, where are you (I)
- [FAQ] summary of common causes and solutions of Huawei account service error 907135701
- Velodyne configuration command
- Student achievement management system (C language)
- Introduction to tree and binary tree
- Rhcsa learning practice
猜你喜欢

BGP ---- border gateway routing protocol ----- basic experiment

leetcode1-3

Basic principle of servlet and application of common API methods

The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server

Number of relationship models

C language - stack

Tables in the thesis of latex learning

When I forget how to write SQL, I

If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display

MongoDB数据日期显示相差8小时 原因和解决方案
随机推荐
Three schemes of ZK double machine room
Seven examples to understand the storage rules of shaped data on each bit
Rhcsa - day 13
Knapsack problem and 0-1 knapsack problem
uniapp 处理过去时间对比现在时间的时间差 如刚刚、几分钟前,几小时前,几个月前
Servlet基本原理与常见API方法的应用
Introduction to extensible system architecture
Doris / Clickhouse / Hudi, a phased summary in June
MongoDB数据日期显示相差8小时 原因和解决方案
Lavel document reading notes -how to use @auth and @guest directives in lavel
leetcode729. My schedule 1
Si vous ne connaissez pas ces quatre modes de mise en cache, vous osez dire que vous connaissez la mise en cache?
Exercise 7-4 find out the elements that are not common to two arrays (20 points)
Two way process republication + routing policy
Intelligent gateway helps improve industrial data acquisition and utilization
Read a piece of text into the vector object, and each word is stored as an element in the vector. Convert each word in the vector object to uppercase letters. Output the converted elements in the vect
Exercise 9-3 plane vector addition (15 points)
Legion is a network penetration tool
Custom type: structure, enumeration, union
Recursion and divide and conquer strategy