Servers: Implementing Server Documents
| Overview | How Do I | Sample | Tutorial
This article explains the steps you must take to successfully implement a server document if you did not specify the OLE Server option in AppWizard.
To define a server document class
Derive your document class from COleServerDoc instead of CDocument.
Create a server item class derived from COleServerItem.
Implement the OnGetEmbeddedItem member function of your server document class.
OnGetEmbeddedItem is called when the user of a container application creates or edits an embedded item. It should return an item representing the entire document. This should be an object of your COleServerItem-derived class.
Override the Serialize member function to serialize the contents of the document. You do not need to serialize the list of server items unless you are using them to represent the native data in your document. For more information, see Implementing Server Items in the article Servers: Server Items.
When a server document is created, the framework automatically registers the document with the OLE system DLLs. This allows the DLLs to identify the server documents.
For more information, see and in the Class Library Reference.
See Also Servers: Server Items, Servers: Implementing a Server, Servers: Implementing In-Place Frame Windows