当前位置:网站首页>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
边栏推荐
- IPv6 comprehensive experiment
- Exercise 7-2 finding the maximum value and its subscript (20 points)
- Doris / Clickhouse / Hudi, a phased summary in June
- Container cloud notes
- Write a program that uses pointers to set all elements of an int array to 4.18: 0.
- Si vous ne connaissez pas ces quatre modes de mise en cache, vous osez dire que vous connaissez la mise en cache?
- 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
- Dos:disk operating system, including core startup program and command program
- Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
- 用数据告诉你高考最难的省份是哪里!
猜你喜欢

Basic data types of MySQL

For programmers, if it hurts the most...

How do microservices aggregate API documents? This wave of show~

Huge number multiplication (C language)

Introduction to tree and binary tree
如果不知道這4種緩存模式,敢說懂緩存嗎?

Use the data to tell you where is the most difficult province for the college entrance examination!

Histogram equalization

The future education examination system cannot answer questions, and there is no response after clicking on the options, and the answers will not be recorded

Remove linked list elements
随机推荐
Uniapp--- initial use of websocket (long link implementation)
Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
Four characteristics and isolation levels of database transactions
Two way process republication + routing policy
AUTOSAR从入门到精通100讲(106)-域控制器中的SOA
Hlk-w801wifi connection
【OpenCV 例程200篇】218. 多行倾斜文字水印
用数据告诉你高考最难的省份是哪里!
Exercise 9-4 finding books (20 points)
IPv6 comprehensive experiment
Work order management system OTRs
Three schemes of ZK double machine room
Evolution from monomer architecture to microservice architecture
uniapp---初步使用websocket(长链接实现)
Reasons and solutions for the 8-hour difference in mongodb data date display
C language - stack
Today's sleep quality record 78 points
按键精灵跑商学习-商品数量、价格提醒、判断背包
How do microservices aggregate API documents? This wave of show~
Servlet基本原理与常见API方法的应用