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 code | Description |
|---|---|
|
The dialog box was created successfully. |
|
Unable to load picture stream. |
|
The address in ppvRet is NULL. |
|
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 |
|
|
Library |
|
|
DLL |
|
See also