IOleDocumentView::GetDocument method

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

Syntax


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

Parameters

ppunk [out]

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

DocObj.h

IDL

DocObj.Idl

IID

IID_IOleDocumentView is defined as b722bcc6-4e68-101b-a2bc-00aa00404770

See also

IOleDocumentView
IUnknown

 

 

Show: