Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 4.1 KB

nf-docobj-ioledocumentview-closeview.md

File metadata and controls

85 lines (63 loc) · 4.1 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:docobj.IOleDocumentView.CloseView
IOleDocumentView::CloseView (docobj.h)
Instructs a document view to close itself and release its IOleInPlaceSite pointer.
CloseView
CloseView method [COM]
CloseView method [COM]
IOleDocumentView interface
IOleDocumentView interface [COM]
CloseView method
IOleDocumentView.CloseView
IOleDocumentView::CloseView
_ole_ioledocumentview_closeview
com.ioledocumentview_closeview
docobj/IOleDocumentView::CloseView
com\ioledocumentview_closeview.htm
com
d2f443de-929e-4bd4-bfb3-2a28c119c176
12/05/2018
CloseView, CloseView method [COM], CloseView method [COM],IOleDocumentView interface, IOleDocumentView interface [COM],CloseView method, IOleDocumentView.CloseView, IOleDocumentView::CloseView, _ole_ioledocumentview_closeview, com.ioledocumentview_closeview, docobj/IOleDocumentView::CloseView
docobj.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
DocObj.Idl
Windows
19H1
IOleDocumentView::CloseView
docobj/IOleDocumentView::CloseView
c++
APIRef
kbSyntax
COM
DocObj.h
IOleDocumentView.CloseView

IOleDocumentView::CloseView

-description

Instructs a document view to close itself and release its IOleInPlaceSite pointer.

-parameters

-param dwReserved [in]

This parameter is reserved and cannot be NULL.

-returns

This method returns S_OK on success.

-remarks

When a separate window is no longer needed, the container calls IOleDocumentView::CloseView, whereupon the view releases its site pointer to the separate window and destroys the window. Unlike the normal in-place deactivation sequence for active documents, a document view continues to hold the IOleInPlaceSite pointer. This pointer is released only when the view's container calls SetInPlaceSite, with pIPSite set to NULL, or calls IOleDocumentView::CloseView.

When a user closes a view's separate window, the view should not shut itself down. Instead, it should call IOleInPlaceSite::OnInPlaceActivate. The view site then decides whether to call IOleDocumentView::UIActivate with FALSE immediately or later. In this way, a document view displayed in a separate window remains available for activation in the container's own window.

The container must call this method before it deletes the view, that is, releases its last reference to the view. In general, implementation of this method will call IOleDocumentView::Show with FALSE to hide the view if it is not already hidden, then call SetInPlaceSite with NULL to deactivate itself and release the view site pointer.

Because IOleDocumentView::CloseView is called when a container is going to completely shut down a view, this method must be implemented and has no reason to fail.

-see-also

IOleDocumentView

IOleDocumentView::SetInPlaceSite

IOleDocumentView::Show