IOleDocumentView::CloseViewIOleDocumentView::CloseView*
*



Contents  *



Index  *Topic Contents
*Previous Topic: IOleDocumentView::Clone
*Next Topic: IOleDocumentView::GetDocument

IOleDocumentView::CloseView

HRESULT CloseView(
    DWORD dwReserved
   );

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

dwReserved
Reserved; must be zero.

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 in-place active objects, a document view continues to hold the IOleInPlaceSite pointer. This pointer is released only when the view's container calls IOleDocumentView::SetInPlaceSite, with the pIPSite parameter set to NULL, or calls IOleDocumentView::CloseView.

When a user closes a view's 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 to UI-deactivate the view immediately or later. In this way, a document view displayed in a 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 IOleDocumentView::SetInPlaceSite with NULL 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.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.