Marshalling a VARIANT containing a SAFEARRAY of VARIANTs each containing an IDispatch



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

.



Relevant Pages

  • Re: Getting a ValueError with comtypes
    ... wrapper, but I've been struggling to get it to work. ... I am working with comtypes to interface Microsoft's DirectShow library. ... searches the $PATH to find type libraries. ... COMMETHOD(, HRESULT, 'Pause'), ...
    (comp.lang.python)
  • Re: [patch 05/11] syslets: core code
    ... It was not added by me - it is just a wrapper. ... though) - if you do not want to allocate it explicitly - it is possible ... What exactly do _you_ expect from interface? ... I can work with explicit structure allocation/deallocation/setup - ...
    (Linux-Kernel)
  • Re: compilers
    ... I do it on my free time, which isn't really that often now. ... an MS.NET interface will be ... This statement defines a wrapper to call a non-.NET DLL (QMClient.dll ... with the assumption that much of the core ...
    (comp.databases.pick)
  • Re: as the dust settles (hopefully the last of this)
    ... Evil Son expressed very well what I was unable to. ... Speaking of the wrapper, though, your wrapper code will leave behind ... in the original interface to begin with. ... specifying formal arguments for the coroutine command. ...
    (comp.lang.tcl)
  • Re: Cannot solve complex problem
    ... Interfaces as well as userdefined Collations are in ... And the wrapper as it comes as Binary has already ... ' to Implement the small Interface for userdefinable Collations ... Private SC As cStringCompare, LCID_DE As Long, LCID_DE_PhoneBook As Long ...
    (microsoft.public.vb.general.discussion)