IOleDocumentView::SetRect

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

[input_sync] HRESULT SetRect(
  LPRECT prcView  // Pointer to the coordinates of the view port
);
 

Parameters

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

Return Value

This method supports the standard return value E_FAIL, as well as the following:

S_OK
The view was successfully resized.

Remarks

For a single document interface (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 a multiple document interface (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.

Whenever the window used to display a document object is resized, the container should call SetRect (or SetRectComplex) to tell the document view object to resize itself to 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 passed in *prcView.

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

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

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in docobj.h.

See Also

IOleInPlaceSite::GetWindow