IOleDocumentView::GetDocument method (docobj.h)

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

Syntax

HRESULT GetDocument(
  [out] IUnknown **ppunk
);

Parameters

[out] ppunk

A pointer to an IUnknown interface pointer that receives a pointer to the document object that owns this view.

Return value

This method returns S_OK on success. S_OK is the only valid return value for this method.

Remarks

The caller is responsible for incrementing the reference count on the interface pointer obtained by this method. The caller must call IUnknown::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 IUnknown::AddRef on the pointer stored in ppunk.

Requirements

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

See also

IOleDocumentView

IUnknown