Re: How to pack void* parameter into DISPPARAMS.rgvarg?
brosembob@yahoo.com wrote:
I'm invoking a method in C# object. In this particular instance I have
a way to determine parameter's type and cast it before calling Invoke
method. But in another instance, where type is not specified, how can
you pack a void pointer?
You cannot pack a void pointer. You should define an interface to only
use automation types, otherwise such an interface cannot be used with
IDispatch::Invoke. An automation type is basically anything that can be
packed into a VARIANT, anything for which a VT_* constant is defined.
What is this void* pointer supposed to represent? If it's just a binary
buffer (an array of bytes), pass it around as SAFEARRAY of BYTE, packed
into VARIANT as (VT_UI1 | VT_ARRAY)
--
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