当前位置:网站首页>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
边栏推荐
- From programmers to large-scale distributed architects, where are you (I)
- [untitled]
- Work order management system OTRs
- For programmers, if it hurts the most...
- /*The rewriter outputs the contents of the IA array. It is required that the type defined by typedef cannot be used in the outer loop*/
- 用数据告诉你高考最难的省份是哪里!
- Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
- Software sharing: the best PDF document conversion tool and PDF Suite Enterprise version sharing | with sharing
- Idea SSH channel configuration
- If you don't know these four caching modes, dare you say you understand caching?
猜你喜欢
Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
Seven examples to understand the storage rules of shaped data on each bit
【Day1】 deep-learning-basics
Use the data to tell you where is the most difficult province for the college entrance examination!
183 sets of free resume templates to help everyone find a good job
BGP ---- border gateway routing protocol ----- basic experiment
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2
C language - stack
Rhcsa learning practice
Dynamic address book
随机推荐
MySQL case
DML statement of MySQL Foundation
What is devsecops? Definitions, processes, frameworks and best practices for 2022
Student achievement management system (C language)
Check 15 developer tools of Alibaba
leetcode842. Split the array into Fibonacci sequences
如果不知道這4種緩存模式,敢說懂緩存嗎?
Remove linked list elements
Sword finger offer 31 Stack push in and pop-up sequence
Servlet基本原理与常见API方法的应用
/*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*/
Software sharing: the best PDF document conversion tool and PDF Suite Enterprise version sharing | with sharing
Dynamic memory management
Collection of practical string functions
Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
Uniapp--- initial use of websocket (long link implementation)
按键精灵打怪学习-识别所在地图、跑图、进入帮派识别NPC
Write a program that uses pointers to set all elements of an int array to 4.18: 0.
PHP代码审计3—系统重装漏洞