Condividi tramite


COleServerDoc::GetDocObjectServer

Eseguire l'override della funzione per creare un nuovo elemento CDocObjectServer e restituire un puntatore su.

virtual CDocObjectServer* GetDocObjectServer( 
   LPOLEDOCUMENTSITE pDocSite  
);

Parametri

  • pDocSite
    Puntatore a un'interfaccia IOleDocumentSite che connette il documento al server.

Valore restituito

Un puntatore a CDocObjectServer; NULL se l'operazione ha esito negativo.

Note

Quando un server di DocObject è attivato, il ritorno di un puntatore null non viene indicato che il client può supportare DocObjects.l'implementazione predefinita restituisce NULL.

Un'implementazione tipica per un documento che supporta DocObjects allocherà semplicemente un nuovo oggetto CDocObjectServer e lo restituirà il chiamante.Di seguito è riportato un esempio:

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

Requisiti

Header: afxole.h

Vedere anche

Riferimenti

Classe di COleServerDoc

Grafico della gerarchia

CDocObjectServer::CDocObjectServer