On Fri, 27 Nov 2009, Alex Strickland wrote: Hi,
> I have an OLE dll that I am trying to use. I think it returns a > safearray of IUnknown. > To understand a bit better I put the following 3 debug lines in olecore.c: > void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) > { > char debug[ 100 ]; > if( pVariant->n1.n2.vt == ( VT_VARIANT | VT_BYREF ) ) > pVariant = pVariant->n1.n2.n3.pvarVal; > sprintf( debug, "hb_oleVariantToItem - pVariant->n1.n2.vt = %x, > VT_UNKNOWN | VT_ARRAY = %x", pVariant->n1.n2.vt, VT_UNKNOWN | > VT_ARRAY ); > OutputDebugString( debug ); > switch( pVariant->n1.n2.vt ) > ... > and I get: > hb_oleVariantToItem - pVariant->n1.n2.vt = 200d, VT_UNKNOWN | VT_ARRAY = 200d Yes, it's safearray of IUnknown values. > In the accompanying IDL file it is the return from: > interface _CardCOM : IDispatch { > [id(0x00000001)] > HRESULT Validate( > [in] BSTR number, > [in] BSTR code, > [out, retval] SAFEARRAY(_CardComRetValidate*)* > pRetVal); > Is it possible to add support for this? Now such parameters are ignored and you receive them as NIL. We support only safearrays of variants. We can extend it and add support for other types in safearrays. You asked about support for safearrays of IUnknown values but so far we do not even support of VT_UNKNOWN variants and this has to be done first. We can try to translate VT_UNKNOWN to some Harbour item, i.e. xHarbour for IUnknown variants try to execute QueryInterface to extract IDispatch value to return it as OLE object. I can commit code which also makes such translation for tests. Please confirm if it's expected behavior and it works. Then we can talk about adding support for translating safearrays of other then variant values. best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour