OleCreatePictureIndirect Function

Creates a new picture object initialized according to a PICTDESC structure.

Syntax

C++
HRESULT OleCreatePictureIndirect(
  __in   LPPICTDESC lpPictDesc,
  __in   REFIID riid,
  __in   BOOL fOwn,
  __out  LPVOID *lplpvObj
);

Parameters

lpPictDesc [in]

Pointer to a caller-allocated structure containing the initial state of the picture. The specified structure can be NULL to create an uninitialized object, in the event the picture needs to initialize via IPersistStream::Load.

riid [in]

Reference to the identifier of the interface describing the type of interface pointer to return in lplpvObj.

fOwn [in]

If TRUE, the picture object is to destroy its picture when the object is destroyed. If FALSE, the caller is responsible for destroying the picture.

lplpvObj [out]

Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, this parameter contains the requested interface pointer on the newly created object. If the call is successful, the caller is responsible for calling Release through this interface pointer when the new object is no longer needed. If the call fails, the value is set to NULL.

Return Value

This function returns S_OK on success. Other possible values include the following.

Return codeDescription
E_NOINTERFACE

The object does not support the interface specified in riid.

E_POINTER

The address in pPictDesc or lplpvObj is not valid. For example, it may be NULL.

 

Remarks

The fOwn parameter indicates whether the picture is to own the GDI picture handle for the picture it contains, so that the picture object will destroy its picture when the object itself is destroyed. The function returns an interface pointer to the new picture object specified by the caller in the riid parameter. A QueryInterface is built into this call. The caller is responsible for calling Release through the interface pointer returned.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderOleCtl.h
LibraryOleAut32.lib
DLLOleAut32.dll

See Also

OleLoadPicture
PICTDESC

Send comments about this topic to Microsoft

Build date: 10/22/2009

Tags :


Page view tracker