You have to be careful about the idl emitted. You need to be very explicit
about the structure, is it a ptr to a structure, a pointer to an array of
structure instances, a pointer to an array of pointers to structures. All
of these can be catered for. VB sorts all the references out for you. In
C++ land you have to ensure that your code accesses the structures
correctly. Don Box did an excellant article on this, see:
ActiveX/COM Q&A article in theNov 96 MSJ
Also, see:
Understanding Interface Definition Language which is available on:
www.microsoft.com/msj/0898/idl/idl.htm
Quote:
>Hi all
>I am developing a component on NT 4.0 with SP 4.0 in VB 6.0 SP 4.0 added
the
>feature of passing structures to COM. I am using this feature. All was
>working fine with small structures. I have one giant structure which is 112
>bytes long. I have compiled the VB code into a DLL If I use the com object
>in this DLL in VB 6.0 client every thing works fine (even the huge
>structure). When I try to do the same thing under VC 6.0 I get junk
>structure. The first few fields of the structure are ok but the rest is
>junk.
>What gives???
>Sure would appreciate some light on this.
>Prady