Hi,

Hi,


Przemysław Czerpak wrote:
BTW in MS documentation dimensions are stored in 'unsigned int' instead
of 'int'. Maybe we should follow it?
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.

Yes, perhaps type should be unsigned int. HRESULT is a "general" return value, since MS uses type casting anythere. I my code I even have functions:
void* hb_parnptr( int iParam )
{
   if( ISPOINTER( iParam ) )
      return hb_parptr( iParam );

   if( ISCHAR( iParam ) )
      return ( void* ) hb_parc( iParam );

   if( ISNUM( iParam ) )
      return ( void* ) hb_parnl( iParam );

   return NULL;
}

const char* hb_parcword( int iParam )
{
   if( ISCHAR( iParam ) )
      return hb_parc( iParam );

   if( ISNUM( iParam ) )
      return ( const char* ) ( short ) hb_parni( iParam );

   return NULL;
}

because it is common to use numeric casting to pointers and so on...


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 ) );

Yes, of cause.


2009-11-28 13:27 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbwin/olecore.c ! fixed typo in last commit

I guess it is only cosmetic change, because both punkVal and pdispVal are the two interfaces of the same object. I do not see the difference, though, this could be more nice form, because punkVal is contained inside VARIANT and will be freed on VariantClear() later.


Regards,
Mindaugas

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to