COMException - Type Mismatch - VARIANT* and SAFEARRAY
- From: "Gordon Brooks" <gbrooks@xxxxxxxxxx(nospam)>
- Date: Mon, 12 Sep 2005 13:33:06 -0700
Hi folks,
I'm trying to call a COM method that has the following signature:
long Foobar(long category, VARIANT* handle_list);
The documentation says that handle_list is a SAFEARRAY of longs (int32) that
will be populated by the function. Tlbimp (regardless of /sysarray) gives me
a signature like:
int32 Foobar(int32 category, ref object handle_list);
The IL uses: object& marshal (struct) handle_list
Is there any way to call this function from .NET? No matter what I seem to
supply, I always get a "COMException - Type Mismatch". I've tried creating
arrays and wrapping them in objects, etc to no avail. It seems that even if I
was able to send over an array, the COM function wants to allocate/fill it,
which is going to cause problems.
Thanks,
-G
At this point, I'm wondering if the best approach would be to write a small
C++/VB library that will accept the raw SAFEARRAY, wrap it, and pass it to
the library.
.
- Prev by Date: Re: COM Interop + Threading + Scalability
- Next by Date: Does the CCW for VB6 to .NET interop give me early or late binding?
- Previous by thread: Can't access .NET class when running VB6 project in IDE
- Next by thread: Does the CCW for VB6 to .NET interop give me early or late binding?
- Index(es):
Relevant Pages
|