# IOleDocumentView::GetDocument

Returns the IUnknown interface pointer of 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.

Return Value

S_OK
  The document object’s interface pointer was successfully returned. This is the only valid return value for this function.

Remarks

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

Because a document owning the view must always exist, this method will always succeed. Before returning, this method should call AddRef on the pointer stored in *ppunk.

See Also

IUnknown