IOleDocument::CreateView method (docobj.h)
Creates a document view object in the caller's process and obtains a pointer to that object's IOleDocumentView interface.
HRESULT CreateView(
[in] IOleInPlaceSite *pIPSite,
[in] IStream *pstm,
[in] DWORD dwReserved,
[out] IOleDocumentView **ppView
);
[in] pIPSite
A pointer to the IOleInPlaceSite interface that represents the view site object to be associated with the new document view object. This parameter can be NULL, for example, when the view is contained in a new, uninitialized document object, in which case the caller must initialize the view with a subsequent call to IOleDocumentView::SetInPlaceSite.
[in] pstm
A pointer to a stream containing data from which the new document view object should initialize itself. If NULL, the document object initializes the new document view object with a default state.
[in] dwReserved
This parameter is reserved and must be zero.
[out] ppView
A pointer to an IOleDocumentView pointer variable that receives the interface pointer to the new document view object. When successful, the caller is responsible for calling IUnknown::Release on the ppview pointer when the view object is no longer needed.
This method returns S_OK on success. Other possible return values include the following.
Return code | Description |
---|---|
|
The operation failed. |
|
Insufficient memory available for the operation. |
|
An unexpected error has occurred. |
|
The address in ppView is NULL. |
A document object container's document site calls CreateView to instruct a document object to create a new view of itself in the container's process, either from default data or using the contents of an existing stream.
Calling CreateView does not cause the new view to display itself. To do so requires a call to either IOleDocumentView::Show or IOleDocumentView::UIActivate.
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 |
IOleDocumentView::ApplyViewState