当前位置:网站首页>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
边栏推荐
- 【Day2】 convolutional-neural-networks
- Exercise 8-10 output student grades (20 points)
- Evolution from monomer architecture to microservice architecture
- Linked list operation can never change without its roots
- Work order management system OTRs
- 原生div具有编辑能力
- The bamboo shadow sweeps the steps, the dust does not move, and the moon passes through the marsh without trace -- in-depth understanding of the pointer
- OSPF comprehensive experiment
- [200 opencv routines] 218 Multi line italic text watermark
- 【Day1】 deep-learning-basics
猜你喜欢
VLAN part of switching technology
BGP advanced experiment
用数据告诉你高考最难的省份是哪里!
From programmers to large-scale distributed architects, where are you (2)
Three schemes of ZK double machine room
The bamboo shadow sweeps the steps, the dust does not move, and the moon passes through the marsh without trace -- in-depth understanding of the pointer
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 2
Four characteristics and isolation levels of database transactions
六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
Remove linked list elements
随机推荐
Knapsack problem and 0-1 knapsack problem
Latex insert picture, insert formula
Exercise 9-4 finding books (20 points)
2. Data type
Lavel document reading notes -how to use @auth and @guest directives in lavel
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
Ruby time format conversion strftime MS matching format
Occasional pit compiled by idea
Network disk installation
183 sets of free resume templates to help everyone find a good job
What is devsecops? Definitions, processes, frameworks and best practices for 2022
Use the data to tell you where is the most difficult province for the college entrance examination!
Idea SSH channel configuration
Differences among opencv versions
Rhcsa day 9
From programmers to large-scale distributed architects, where are you (I)
Debug:==42==ERROR: AddressSanitizer: heap-buffer-overflow on address
/*Write a function to open the file for input, read the contents of the file into the vector container of string class 8.9: type, and store each line as an element of the container object*/
Talk about scalability
Exercise 7-2 finding the maximum value and its subscript (20 points)