当前位置:网站首页>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
边栏推荐
- [200 opencv routines] 218 Multi line italic text watermark
- 入职中国平安三周年的一些总结
- Exercise 7-3 store the numbers in the array in reverse order (20 points)
- Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
- Occasional pit compiled by idea
- Rhsca day 11 operation
- Legion is a network penetration tool
- When I forget how to write SQL, I
- Work order management system OTRs
- 2021-08-11 function pointer
猜你喜欢

Software sharing: the best PDF document conversion tool and PDF Suite Enterprise version sharing | with sharing

Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1

Dynamic memory management

Intelligent gateway helps improve industrial data acquisition and utilization

MongoDB数据日期显示相差8小时 原因和解决方案

From programmers to large-scale distributed architects, where are you (I)
Si vous ne connaissez pas ces quatre modes de mise en cache, vous osez dire que vous connaissez la mise en cache?

Remove linked list elements

Time complexity and space complexity

Debug:==42==ERROR: AddressSanitizer: heap-buffer-overflow on address
随机推荐
Reasons and solutions for the 8-hour difference in mongodb data date display
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1
Four characteristics and isolation levels of database transactions
Exercise 9-4 finding books (20 points)
/*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*/
Reprint: summation formula of proportional series and its derivation process
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 2
【Day1】 deep-learning-basics
Exercise 7-2 finding the maximum value and its subscript (20 points)
Container cloud notes
Collection of practical string functions
BGP advanced experiment
AUTOSAR from getting started to mastering 100 lectures (106) - SOA in domain controllers
Does any teacher know how to inherit richsourcefunction custom reading Mysql to do increment?
Architecture introduction
C language structure to realize simple address book
/*Rewrite the program, find the value of the element, and return the iterator 9.13: pointing to the found element. Make sure that the program works correctly when the element you are looking for does
5g/4g wireless networking scheme for brand chain stores
Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
Servlet基本原理与常见API方法的应用