| title | CDocObjectServerItem Class | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | reference | |||||||||||||
| f1_keywords |
|
|||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 530f7156-50c8-4806-9328-602c9133f622 | |||||||||||||
| caps.latest.revision | 22 | |||||||||||||
| author | mikeblome | |||||||||||||
| ms.author | mblome | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
Implements OLE server verbs specifically for DocObject servers.
class CDocObjectServerItem : public COleServerItem
| Name | Description |
|---|---|
| CDocObjectServerItem::CDocObjectServerItem | Constructs a CDocObjectServerItem object. |
| Name | Description |
|---|---|
| CDocObjectServerItem::GetDocument | Retrieves a pointer to the document that contains the item. |
| Name | Description |
|---|---|
| CDocObjectServerItem::OnHide | Throws an exception if the framework tries to hide a DocObject item. |
| CDocObjectServerItem::OnShow | Called by the framework to make the DocObject item in-place active. If the item is not a DocObject, calls COleServerItem::OnShow. |
CDocObjectServerItem defines overridable member functions: OnHide, OnOpen, and OnShow.
To use CDocObjectServerItem, assure that the OnGetEmbeddedItem override in your COleServerDoc-derived class returns a new CDocObjectServerItem object. If you need to change any functionality in your item, you can create a new instance of your own CDocObjectServerItem-derived class.
For further information on DocObjects, see CDocObjectServer and COleCmdUI in the MFC Reference. Also see Internet First Steps: Active Documents and Active Documents.
CDocObjectServerItem
Header: afxdocob.h
Constructs a CDocObjectServerItem object.
CDocObjectServerItem(COleServerDoc* pServerDoc, BOOL bAutoDelete);
pServerDoc
A pointer to the document that will contain the new DocObject item.
bAutoDelete
Indicates whether the object can be deleted when a link to it is released. Set the argument to FALSE if the CDocObjectServerItem object is an integral part of your document's data. Set it to TRUE if the object is a secondary structure used to identify a range in your document's data that can be deleted by the framework.
Retrieves a pointer to the document that contains the item.
COleServerDoc* GetDocument() const;
A pointer to the document that contains the item; NULL if the item is not part of a document.
This allows access to the server document that you passed as an argument to the CDocObjectServerItem constructor.
Called by the framework to hide the item.
virtual void OnHide();
The default implementation throws an exception if the item is a DocObject. You cannot hide an active DocObject item because it takes the whole view. You must deactivate the DocObject item to make it disappear. If the item is not a DocObject, the default implementation calls COleServerItem::OnHide.
Called by the framework to instruct the server application to make the DocObject item in-place active.
virtual void OnShow();
If the item is not a DocObject, the default implementation calls COleServerItem::OnShow. Override this function if you want to perform special processing when opening a DocObject item.
COleServerItem Class
Hierarchy Chart
CDocObjectServer Class
COleDocObjectItem Class