Contents Previous Page Next Page
IOleDocumentView::SetRect

Sets the rectangular coordinates of the view port in which a view is to be activated.

[input_sync] HRESULT SetRect(

    LPRECT
 prcView          // Pointer to a RECT structure        
                                                                  
   );                                                             
                                                                  

Parameters

prcView

[in] Pointer to a RECT structure containing the coordinates of the view port.

Return Value

S_OK

The view was successfully resized.

E_FAIL

Some other critical error occurred that prevented the view from being resized.

Remarks

For an SDI application, the view port is the client area of the frame window minus the space allocated for tool bars, status bar, and such. For an MDI window, the view port is the client area of the MDI document window minus any other frame-level user-interface elements.

Notes to Callers

Calling IOleDocumentView::SetRect (or SetRectComplex) is part of the normal activation sequece for document objects, usually following a call to IOleDocumentView::UIActivate and preceding a call to IOleDocumentView::Show. In addition, whenever the window used to display a document object is resized, the container should call SetRect (or SetRectComplex) to tell the document object to resize itself to fit the new window dimensions.

Notes to Implementers

The coordinates of the view port are within the coordinates of the view window, which is obtained through IOleInPlaceSite::GetWindow. The view must resize itself to fit the new coordinates.

This method is defined with the [input_sync] attribute, which means that the implementing object cannot yield or make another, non input_sync RPC call while executing this method.

A document view must implement this method completely. Therefore E_NOTIMPL is not an acceptable return value.

See Also

IOleInPlaceSite::GetWindow