IOleDocumentView::Clone method

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

pIPSiteNew [in]

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.

ppViewNew [out]

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 codeDescription
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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

DocObj.h

IDL

DocObj.Idl

IID

IID_IOleDocumentView is defined as b722bcc6-4e68-101b-a2bc-00aa00404770

See also

IOleDocumentView
IOleDocumentView::SetInPlaceSite

 

 

Show: