Re: out param question
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Wed, 18 Jan 2006 08:07:43 -0500
"mysteron" <acornatom66@xxxxxxxxx> wrote in message
news:uzNaFfBHGHA.2012@xxxxxxxxxxxxxxxxxxxx
> the GetThumbnail() method needs to pass a bitmap out to the caller
> ... an arbitrary length array of bytes....
>
> Q: what would be the best way to do this?
>
> GetThumbnail([out] ?? )
If you don't need to be automation-compatible (usable from VB or
scripts), use conformant arrays:
HRESULT GetThumbnail([out] DWORD* pSize, [out, size_is(, *pSize)] BYTE**
pData);
You allocate a block of memory with CoTaskMemAlloc, store the pointer to
it in *pData and its length in *pSize. The caller eventually frees the
data with CoTaskMemFree.
If you do need to be automation-compatible, use a safearray of bytes:
HRESULT GetThumbnail([out, retval] SAFEARRAY(BYTE)* psa);
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: out param question
- From: mysteron
- Re: out param question
- From: mysteron
- Re: out param question
- References:
- out param question
- From: mysteron
- out param question
- Prev by Date: Re: out param question
- Next by Date: Re: Memory ownership, parameters, variants, etc.
- Previous by thread: Re: out param question
- Next by thread: Re: out param question
- Index(es):
Relevant Pages
|