Jediah L.
2009-12-16 13:33:56 UTC
I am trying to call through an interop from C#. The last parameter is
marshalled as an object; but it's underlying type of tagVariant. I have
tried numerous ways to pass this value in from C#, something as complex as
creating a struct that mimics the tagVarariant type in C++ and things as
simple as creating an object array populating it with a ushort and long (to
represent the VT and lVal that I'm passing in).
When I pass the object array I get an exception of specified type is not
valid; when I pass the struct, I get an error stating the value was not in
the expected range.
I'm also aware of of functions called
GetObjectForNativeVariant/GetNativeVariantForObject as part of
the .Net Framework; however, I'm not sure where I would get the Native
Variant reference to pass in to this function to get a reference to the
struct tagVariant defined in OAIDL.h....
Jediah L.
marshalled as an object; but it's underlying type of tagVariant. I have
tried numerous ways to pass this value in from C#, something as complex as
creating a struct that mimics the tagVarariant type in C++ and things as
simple as creating an object array populating it with a ushort and long (to
represent the VT and lVal that I'm passing in).
When I pass the object array I get an exception of specified type is not
valid; when I pass the struct, I get an error stating the value was not in
the expected range.
I'm also aware of of functions called
GetObjectForNativeVariant/GetNativeVariantForObject as part of
the .Net Framework; however, I'm not sure where I would get the Native
Variant reference to pass in to this function to get a reference to the
struct tagVariant defined in OAIDL.h....
Jediah L.