Hi there!
I have a C# assembly which I have checked in the Visual Studio solution
to 'Register for COM Interop', registering the types in the registry
and generates a TLB file - which I am then importing into a C++
program.
My problem seems to be with Arrays - all of the methods in the C#
classes I am dealing with are simple get/set methods that return/accept
Arrays, e.g.
object[] get_method();
void set_method(object[] input);
They then appear in the TLB file as:
SAFEARRAY(VARIANT) get_method();
void set_method([in] SAFEARRAY(VARIANT) input);
Now I'm new to this whole SAFEARRAY business (and COM in general) but,
as I understand (understood!) it, I should be able to call the COM
method in C++ like this...
//where o is the _ObjectPtr
o->get_method();
Obviously I'd need to assign it to something to make any use of it but,
anyway, the get_method() is raising this "Unknown Error" which I just
can't make any sense of.
If I am being unclear, please say so - I've just had my head stuck in
this problem for so long that I could just be spouting nonsense...
Many thanks...
davidcjmack@googlemail.com - 17 Aug 2006 15:16 GMT
now I have to reply to my own post, as I've noticed that I can catch a
_com_error, which provides a Description() method....
"Specified array was not of the expected type."
But if it is not a SAFEARRAY*, then what on earth is it?!
davidcjm...@googlemail.com wrote:
> Hi there!
>
[quoted text clipped - 30 lines]
>
> Many thanks...