IOleDocumentView::GetDocument

Obtains the IUnknown interface pointer on the document object that owns this view.

HRESULT GetDocument(
  IUnknown **ppunk  // On return, pointer to the IUnknown pointer of 
                    // the document object that owns this view
);
 

Parameters

ppunk
[out] Pointer to the IUnknown pointer of the document object that owns this view.

Return Value

S_OK
The document object's interface pointer was successfully obtained. S_OK is the only valid return value for this function.

Remarks

The caller is responsible for incrementing the reference count on the interface pointer obtained by this method. The caller must call Release on this pointer when it is no longer needed.

Because a view object must always be contained or aggregated in a document object, this method will always succeed. Before returning, this method should call AddRef on the pointer stored in *ppunk.

QuickInfo

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

See Also

IUnknown