Condividi tramite


COleServerDoc::GetDocObjectServer

Override this function to create a new CDocObjectServer item and return a pointer to it.

virtual CDocObjectServer* GetDocObjectServer( 
   LPOLEDOCUMENTSITE pDocSite  
);

Parameters

  • pDocSite
    Pointer to the IOleDocumentSite interface that will connect this document to the server.

Return Value

A pointer to a CDocObjectServer; NULL if the operation failed.

Remarks

When a DocObject server is activated, the return of a non-NULL pointer shows that the client can support DocObjects. The default implementation returns NULL.

A typical implementation for a document that supports DocObjects will simply allocate a new CDocObjectServer object and return it to the caller. For example:

CDocObjectServer* CMFCOleServerDoc::GetDocObjectServer(LPOLEDOCUMENTSITE pSite)
{
   return new CDocObjectServer(this, pSite);
}

Requirements

Header: afxole.h

See Also

Reference

COleServerDoc Class

Hierarchy Chart

CDocObjectServer::CDocObjectServer