Contents Previous Page Next Page
IOleDocumentView::Show

Instructs a view to in-place activate or in-place deactivate itself.

HRESULT Show(

    BOOL
 fShow         // Boolean value specifying whether to activate or deactivate the view           
                                                                                                        
   );                                                                                                   
                                                                                                        

Parameters

fShow

[in] TRUE instructs the view to show itself; FALSE instructs the view to hide itself.

Return Value

S_OK

The view was successfully shown or hidden.

E_OUTOFMEMORY

There was not enough memory to activate or hide the view.

E_FAIL

Some other critical error occurred that prevented activation or hiding.

E_UNEXPECTED

This method was called before a call to IOleDocumentView::SetInPlaceSite.

Remarks

Calling IOleDocumentView::Show is the last step in the activation sequence because before showing itself a document object must know exactly what space it occupies and have all its tools available.

Notes to Callers

A call to this method for the purpose of activating a view should follow calls to IOleDocumentView::SetInPlaceSite, IOleDocumentView::UIActivate, and IOleDocumentView::SetRect (or SetRectComplex).

Notes to Implementers

Implementations of this method should embody the following pseudo-code:

if (fShow)

{

In-place activate the view but do not UI activate it.

Show the view window.

}

else

{

Call IOleDocumentView::UIActivate(FALSE) on this view

Hide the view window

}

All views of a document object must at least support the in-place activation mode, therefore E_NOTIMPL is not allowed as a return value.

See Also

IOleDocumentView::SetInPlaceSite, IOleDocumentView::SetRect, IOleDocumentView::SetRectComplex, IOleDocumentView::UIActivate