Upravit

Sdílet prostřednictvím


IOleDocumentView::Clone method (docobj.h)

Creates a duplicate view object with an internal state identical to that of the current view.

Syntax

HRESULT Clone(
  [in]  IOleInPlaceSite  *pIPSiteNew,
  [out] IOleDocumentView **ppViewNew
);

Parameters

[in] pIPSiteNew

A pointer to a IOleInPlaceSite interface that represents the view site in which the new view object will be activated. On receiving this pointer, the view being cloned should pass it to the new view's IOleDocumentView::SetInPlaceSite method. This pointer can be NULL, in which case the caller is responsible for calling IOleDocumentView::SetInPlaceSite on the new view directly.

[out] ppViewNew

A pointer to an IOleDocumentView pointer variable that receives the interface pointer to the new view object. The caller is responsible for releasing ppViewNew when it is no longer needed.

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_POINTER
The value in ppViewNew is NULL.
E_NOTIMPL
The view object does not implement this interface.

Remarks

This method is useful for creating a new view with a different viewport and view site but with the same view context as the view being cloned. Typically, containers hosting an MDI application will call this method to provide "Window/New window" capability.

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

IOleDocumentView

IOleDocumentView::SetInPlaceSite