Upravit

Sdílet prostřednictvím


IOleDocumentView::SetRectComplex method (docobj.h)

Sets the rectangular coordinates of the viewport, scroll bars, and size box.

Syntax

HRESULT SetRectComplex(
  [in] LPRECT prcView,
  [in] LPRECT prcHScroll,
  [in] LPRECT prcVScroll,
  [in] LPRECT prcSizeBox
);

Parameters

[in] prcView

A pointer to a RECT structure containing the coordinates of the viewport.

[in] prcHScroll

A pointer to a RECT structure containing the coordinates of the horizontal scroll bar.

[in] prcVScroll

A pointer to a RECT structure containing the coordinates of the vertical scroll bar.

[in] prcSizeBox

A pointer to a RECT structure containing the coordinates of the size box.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return code Description
E_FAIL
The operation failed.
E_NOTIMPL
The document object that owns this view does not support complex rectangles.

Remarks

View frames that support a workbook metaphor, in which a single document comprises multiple sheets or pages, typically call this method to set the coordinates to be used in common by all the sheets or pages.

Notes to Callers

Calling IOleDocumentView::SetRectComplex is part of the normal activation sequence for document objects that support complex rectangles, 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 IOleDocumentView::SetRectComplex or IOleDocumentView::SetRect to tell the view object to resize itself to the new window dimensions.

Notes to Implementers

Document objects that support complex rectangles mark themselves with DOCMISC_SUPPORTCOMPLEXRECTANGLES, as described in DOCMISC and IOleDocument::GetDocMiscStatus. Document objects that do not support this method can return E_NOTIMPL.

Upon receiving a call to this method, a view should resize itself to fit the coordinates specified in prcView and fit its scrollbars and size box to the areas described in prcHScroll, prcVScroll, and prcSizeBox.

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.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header docobj.h

See also

IOleDocument::GetDocMiscStatus

IOleDocumentView