diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5cf9f36e17..5a6c8e4283 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2011-08-08 12:13 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/hbcomhb.c + * indenting + + * harbour/contrib/xhb/xhb.hbp + - harbour/contrib/xhb/xthrow.prg + + harbour/contrib/xhb/xthrow.c + * rewritten THROW() function in C + + * harbour/contrib/hbwin/olecore.c + + add PRG function __OLEISDISP() which can be used to verify if given + parameter is Harbour OLE pointer item. + 2011-08-07 19:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + better accept libs passed as names in oldschool 'name.lib' format diff --git a/harbour/contrib/hbwin/olecore.c b/harbour/contrib/hbwin/olecore.c index 9b22934e72..99ea919079 100644 --- a/harbour/contrib/hbwin/olecore.c +++ b/harbour/contrib/hbwin/olecore.c @@ -1297,6 +1297,11 @@ static void FreeParams( DISPPARAMS * dispparam ) /* PRG level functions and methods */ +HB_FUNC( __OLEISDISP ) +{ + hb_retl( hb_oleItemGet( hb_param( 1, HB_IT_ANY ) ) != NIL ); +} + HB_FUNC( __OLECREATEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ { wchar_t* cCLSID; diff --git a/harbour/contrib/xhb/xhb.hbp b/harbour/contrib/xhb/xhb.hbp index 157d8a8423..0bafe3fbef 100644 --- a/harbour/contrib/xhb/xhb.hbp +++ b/harbour/contrib/xhb/xhb.hbp @@ -73,6 +73,7 @@ xhbscr.c xhbtrim.c xhbwith.c xstrdel.c +xthrow.c xwin_reg.c xwin_ver.c @@ -105,7 +106,6 @@ xhbmemo.prg xhbmt.prg xhbtedit.prg xhbver.prg -xthrow.prg xhw32prn.prg hjwindow.prg diff --git a/harbour/contrib/xhb/xthrow.prg b/harbour/contrib/xhb/xthrow.c similarity index 81% rename from harbour/contrib/xhb/xthrow.prg rename to harbour/contrib/xhb/xthrow.c index 2c6b29d5c2..b1f88c6e0c 100644 --- a/harbour/contrib/xhb/xthrow.prg +++ b/harbour/contrib/xhb/xthrow.c @@ -4,9 +4,9 @@ /* * Harbour Project source code: - * THROW() compatibility function + * THROW() compatibility function * - * Copyright 2009 Viktor Szakats (harbour.01 syenar.hu) + * Copyright 2007 Przemyslaw Czerpak * www - http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -50,7 +50,20 @@ * */ -PROCEDURE THROW( oError ) +#include "hbapi.h" +#include "hbapiitm.h" +#include "hbapierr.h" - Eval( ErrorBlock(), oError ) - Break( oError ) +HB_FUNC( THROW ) +{ + PHB_ITEM pError = hb_param( 1, HB_IT_ANY ); + + if( pError && HB_IS_OBJECT( pError ) ) + { + PHB_ITEM pResult = hb_errLaunchSubst( pError ); + if( pResult ) + hb_itemReturnRelease( pResult ); + } + else + hb_errRT_BASE( EG_ARG, 9101, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); +} diff --git a/harbour/src/rtl/hbcomhb.c b/harbour/src/rtl/hbcomhb.c index d4c36914b4..267f8c4adf 100644 --- a/harbour/src/rtl/hbcomhb.c +++ b/harbour/src/rtl/hbcomhb.c @@ -220,22 +220,22 @@ HB_FUNC( HB_COMSETERROR ) HB_FUNC( HB_COMRECV ) { - PHB_ITEM pItem = hb_param( 2, HB_IT_STRING ); - char * pBuffer; - HB_SIZE nLen; + PHB_ITEM pItem = hb_param( 2, HB_IT_STRING ); + char * pBuffer; + HB_SIZE nLen; - if( pItem && HB_ISBYREF( 2 ) && hb_itemGetWriteCL( pItem, &pBuffer, &nLen ) ) - { - if( HB_ISNUM( 3 ) ) - { - long lRead = hb_parnl( 3 ); - if( lRead >= 0 && lRead < ( long ) nLen ) - nLen = lRead; - } - hb_retnl( hb_comRecv( hb_parni( 1 ), pBuffer, ( long ) nLen, hb_parnint( 4 ) ) ); - } - else - hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + if( pItem && HB_ISBYREF( 2 ) && hb_itemGetWriteCL( pItem, &pBuffer, &nLen ) ) + { + if( HB_ISNUM( 3 ) ) + { + long lRead = hb_parnl( 3 ); + if( lRead >= 0 && lRead < ( long ) nLen ) + nLen = lRead; + } + hb_retnl( hb_comRecv( hb_parni( 1 ), pBuffer, ( long ) nLen, hb_parnint( 4 ) ) ); + } + else + hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } HB_FUNC( HB_COMSEND )