IOleDocumentView::Clone

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

HRESULT Clone(
  IOleInPlaceSite *pIPSiteNew  // Pointer to view site of new view 
                               // object
  IOleDocumentView **ppViewNew  //Address of output variable that 
                                // receives the IOleDocumentView 
                                // interface pointer
);
 

Parameters

pIPSiteNew
[in] Pointer to 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 SetInPlaceSite method. This pointer can be NULL, in which case the caller is responsible for calling SetInPlaceSite on the new view directly.
ppViewNew
[out] Address of 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 Values

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

S_OK
The view was successfully cloned.
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 view port 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.

QuickInfo

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

See Also

IOleDocumentView, IOleDocumentView::SetInPlaceSite