For a long time, I have not systematically read the 23 design models in one breath, and I will always check them online. I had no time to think about these 23 design models, so I was always unable to understand the MFC framework, and it was really painful. Today, when I was studying mahjong, I established an SDI project, so I roughly studied this framework.
I have the following experiences:
During the setup of the SDI wizard, vc6.0 did the following for us:
1. New objects include doc, frame, and view.
2. Two windows, frame and view, are created.
3. save the frame object address to the app object, save the doc object address to the view object, and insert the view object address to a table in the doc object, save the view object address to the frame object. runtime_class is used to dynamically create the objects generated by the Wizard. In fact, it is new.
Here we will post several important class structures. I will extract the essence and paste them here:
Class cview: Public cwnd
{
Public:
Cdocument * getdocument () const;
Protected:
Cdocument * m_pdocument;
Friend class cdocument;
Friend class cdoctemplate;
}
Class cdocument: Public c0000target
{
Protected:
Cdoctemplate * m_pdoctemplate;
}
Too busy. First paste the cview and the relevant cdocument section, and write the other sections of DOC/View/frame later.