On Fri, 27 Nov 2009, Mindaugas Kavaliauskas wrote: Hi,
> >BTW in MS documentation dimensions are stored in 'unsigned int' instead > >of 'int'. Maybe we should follow it? > MSDN writes: > HRESULT SafeArrayGetDim( SAFEARRAY FAR* psa ); > BCC wtypes.h has: > #ifndef _HRESULT_DEFINED > #define _HRESULT_DEFINED > typedef LONG HRESULT; > #endif // !_HRESULT_DEFINED > > So, it's long, not unsigned int. But the most strange thing is that > SafeArrayGetDim return HRESULT. Sounds like a handler, and this > stopped me from beeper analysis. I just used int. Actually it was a > bad idea, to not check real type. It's not the first or last place where MS mixed different types. BTW I replaced SUCCEDD() used to check SafeArrayGetElement() results with comparison to S_OK - SUCCEDD(n) is defined as (n>=0) > Please, fix it. SafeArrayGetDim() returns LONG but SafeArrayCreate() accepts as dim parameter UINT value so I'm really confused what should I chose. On 32bit platforms it's not possible to exploit this problem due to limited address space and I rather do not expect that on 64bit ones someone will create such big array (it will be necessary to start from negative indexes) so maybe we can leave it as is. BTW I have question about code in axcore.c. In function __AXDOVERB() we have call to QueryInterface() but without call to Release(). Shouldn't we add at axcore.c[213]: HB_VTBL( lpOleObject )->Release( HB_THIS( lpOleObject ) ); ??? best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour