Visual C Application Framework reveals the power of Optoelectronics Engineering of Beijing Institute of Technology Lu Yingwei Computer Programming Skills and Maintaining the power of the 1999.1 P30visual C application framework, providing great convenience for our proceeds, using its application builder can be easily Generate an application framework. Many common functions, such as the creation of documents, files to open, save, etc. are done by the application framework. These operations are transparent to the development of software users. Microsoft The original intention of designing Visual C is to try to provide users with simple interfaces, but it is because of the transparency of the application framework, making the Visual C running process very mysterious when involving these Visual C has provided function modules When software development, users (especially those who have just contacted Visual C don't know when to use what interface functions, I don't know where to get started, so that the difficulty of development is increased. I am In the programming practice, it is found that the application frame code can be tracked by Visual C , and the application frame code can be tracked, thereby obtaining the partial flow of the application framework operation. The specific implementation is: use the Visual C application generator to generate an application frame code, start ClassWizard In each class, the interface function, edit the interface function, set breakpoints, and then start Debug for single-step tracking debugging. Use this method, we can also track the example code provided by Visual C . During the tracking process, The core code of Visual C is forbidden to track debugging. We just skip it. The following is the tracking result of the document creation, file opening, saving (saving (saving) operation, single document application and multi-document application The operation process is basically similar, just use the CSINGLEDEMPLATE class function to replace the call to the CMULTIDEMPLATE class with the same name function. In the following description, "Applications" refer to the user-generated application framework, "user code" means the user The code added to the interface function. 1. Create a document ON_COMMAND (ID_FILE_NEW, CWINAPP: CWINAP :: ONFileNew Call: cdocmanager :: OnfileNew () 1. Judging There is no document template, the function returns; 2. Judgment Do you have multiple document templates, if you start the Document Template Select dialog box, let the user select a template to return to the template pointer. 3. Access the cmultidEcTemplate :: OpenDocumentFile () 31 by template pointer () 31. Create a new document object 32. Creating a sub-frame, a structural frame, a document, and a window with a new document object 33. Call the application's OnNewDocument () a. Call cdocument :: OnNewDocument () call the application's deleteContents ();