Server Document and Items
There are some basic services that an OLE document server must provide to a container application. MFC implements many of these services in the COleServerDoc and COleServerItem classes. Your application must contain classes that derive from these two base classes, and must override some of their methods to implement certain services.
The COleServerDoc class encapsulates a document that is either linked or embedded in one or more container documents. It derives from CDocument and is responsible for maintaining a list of CDocItem objects. The document class in your application should be derived from COleServerDoc.
The COleServerItem class derives from CDocItem, and has the same relationship to the COleServerDoc class as a CView. Server item objects are created by the COleServerDoc::OnGetEmbeddedItem() method, and each server item has a pointer back to the document that created it. A server item provides a view of the document when it is linked or embedded in a container application.