Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
OleLoadPicturePath
Collapse the table of content
Expand the table of content

OleLoadPicturePath function

Creates a new picture object and initializes it from the contents of a stream. This is equivalent to calling OleCreatePictureIndirect(NULL, ...) followed by IPersistStream::Load.

Syntax


HRESULT OleLoadPicturePath(
  _In_  LPOLESTR  szURLorPath,
  _In_  LPUNKNOWN punkCaller,
  _In_  DWORD     dwReserved,
  _In_  OLE_COLOR clrReserved,
  _In_  REFIID    riid,
  _Out_ LPVOID    *ppvRet
);

Parameters

szURLorPath [in]

The path or URL to the file you want to open.

punkCaller [in]

Points to IUnknown for COM aggregation.

dwReserved [in]

Reserved.

clrReserved [in]

The color you want to reserve to be transparent.

riid [in]

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

ppvRet [out]

Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvRet contains the requested interface pointer on the storage of the object identified by the moniker. If *ppvRet is non-NULL, this function calls IUnknown::AddRef on the interface; it is the caller's responsibility to call IUnknown::Release. If an error occurs, *ppvRet is set to NULL.

Return value

This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:

Return codeDescription
S_OK

The dialog box was created successfully.

E_FAIL

Unable to load picture stream.

E_POINTER

The address in ppvRet is NULL.

E_NOINTERFACE

The object does not support the interface specified in riid.

 

Remarks

The stream must be in BMP (bitmap), JPEG, WMF (metafile), ICO (icon), or GIF format.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OleCtl.h

Library

OleAut32.lib

DLL

OleAut32.dll

See also

OleLoadPicture

 

 

Community Additions

ADD
Show:
© 2015 Microsoft