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.
This commit is contained in:
Przemyslaw Czerpak
2011-08-08 10:13:50 +00:00
parent 56fac2097f
commit b814c028a8
5 changed files with 52 additions and 21 deletions

View File

@@ -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

View File

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

View File

@@ -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

View File

@@ -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 <druzus / at / priv.onet.pl>
* 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 );
}

View File

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