Marshalling a VARIANT containing a SAFEARRAY of VARIANTs each containing an IDispatch
- From: dinane@xxxxxxxxx
- Date: 11 Dec 2006 12:16:07 -0800
I have what I think is a very peculiar problem. I am using a
predefined COM object from .NET. The COM object was provided with a
wrapper already implemented, but I believe it was just created by
adding the COM object's DLL as a reference to a .NET project.
This COM object has a field which requires its input to be a VARIANT
containing a SAFEARRAY of VARIANTs each containing an interface pointer
of IDispatch type. This is not the standard marshalling for an array
of interfaces out of .NET. I'm wondering if there is any way that I
can actively marshal my .NET array of interface references to that
complex safearray contraption.
I would prefer not to have to re-implement the COM Wrapper using
[ComWrapper], as it is a very large class out of a larger collection of
classes in one DLL, and I already use quite a bit of it. It would be a
rather large amount of code. But if that is the only option, I can
consider it. Unfortunately, I have been unable to find a way to use
[MarshalAs] on a property set - which is really what I need. The get
syntax is reasonable (using [return : MarshalAs(...)]), but I haven't
found set syntax anywhere.
And even finding that might not solve my problem completely, as I'm not
entirely sure how to represent this complex contraption in a
MarshalAs().
I really appreciate any help.
Thank you
~d
.
- Follow-Ups:
- Prev by Date: Print Preview very specific question regarding print preview dialog box
- Next by Date: Re: Marshalling a VARIANT containing a SAFEARRAY of VARIANTs each containing an IDispatch
- Previous by thread: Print Preview very specific question regarding print preview dialog box
- Next by thread: Re: Marshalling a VARIANT containing a SAFEARRAY of VARIANTs each containing an IDispatch
- Index(es):
Relevant Pages
|