2010-05-20 19:49 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/src/rdd/dbf1.c
    * minor cleanup

  * harbour/include/hbapi.h
    + added new macro HB_IS_EVALITEM() - returns true for items which can
      understand EVAL message i.e. CODEBLOCK and SYMBOL items.

  * harbour/contrib/hbwin/axcore.c
  * harbour/contrib/hbwin/olecore.c
  * harbour/contrib/hbwin/hbwinole.h
    * modified hb_oleDispInvoke() function to accept as additional
      parameter pointer to HVM item instead of pointer to DISPID.
      Such version is more universal.
This commit is contained in:
Przemyslaw Czerpak
2010-05-20 17:50:09 +00:00
parent 93eb2031b3
commit 54b5e1564a
6 changed files with 47 additions and 23 deletions

View File

@@ -17,6 +17,21 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-05-20 19:49 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rdd/dbf1.c
* minor cleanup
* harbour/include/hbapi.h
+ added new macro HB_IS_EVALITEM() - returns true for items which can
understand EVAL message i.e. CODEBLOCK and SYMBOL items.
* harbour/contrib/hbwin/axcore.c
* harbour/contrib/hbwin/olecore.c
* harbour/contrib/hbwin/hbwinole.h
* modified hb_oleDispInvoke() function to accept as additional
parameter pointer to HVM item instead of pointer to DISPID.
Such version is more universal.
2010-05-20 16:22 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbide/qscintilla
- Deleted this hosted foreign code for reasons explained

View File

@@ -325,7 +325,8 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
VARIANT* pVarResult, EXCEPINFO* pExcepInfo,
UINT* puArgErr )
{
PHB_ITEM pAction, pKey = NULL;
PHB_ITEM pAction;
HRESULT hr;
HB_SYMBOL_UNUSED( lcid );
HB_SYMBOL_UNUSED( wFlags );
@@ -335,20 +336,24 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
if( ! IsEqualIID( riid, HB_ID_REF( IID_NULL ) ) )
return DISP_E_UNKNOWNINTERFACE;
pAction = ( ( ISink* ) lpThis )->pItemHandler;
hr = DISP_E_MEMBERNOTFOUND;
if( pAction && HB_IS_HASH( pAction ) )
pAction = ( ( ISink* ) lpThis )->pItemHandler;
if( pAction )
{
pKey = hb_itemPutNL( pKey, ( long ) dispid );
pAction = hb_hashGetItemPtr( pAction, pKey, 0 );
hb_itemRelease( pKey );
PHB_ITEM pKey = hb_itemPutNL( hb_stackAllocItem(), ( long ) dispid );
if( pAction && HB_IS_HASH( pAction ) )
pAction = hb_hashGetItemPtr( pAction, pKey, 0 );
if( pAction && hb_oleDispInvoke( NULL, pAction, pKey,
pParams, pVarResult ) )
hr = S_OK;
hb_stackPop();
}
if( pAction && hb_oleDispInvoke( NULL, pAction, pKey ? NULL : &dispid,
pParams, pVarResult ) )
return S_OK;
else
return DISP_E_MEMBERNOTFOUND;
return hr;
}

View File

@@ -116,7 +116,7 @@ HB_EXPORT IDispatch* hb_oleItemGet( PHB_ITEM pItem );
HB_EXPORT PHB_ITEM hb_oleItemPut( PHB_ITEM pItem, IDispatch* pDisp );
HB_EXPORT PHB_ITEM hb_oleItemGetCallBack( PHB_ITEM pItem );
HB_EXPORT void hb_oleItemSetCallBack( PHB_ITEM pItem, PHB_ITEM* pCallBack );
HB_EXPORT HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, DISPID* pDispId,
HB_EXPORT HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
DISPPARAMS* pParams, VARIANT* pVarResult );
/* activex control */

View File

@@ -1051,7 +1051,7 @@ typedef struct
}
HB_OLE_PARAM_REF;
HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, DISPID* pDispId,
HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
DISPPARAMS* pParams, VARIANT* pVarResult )
{
if( !pSym && HB_IS_SYMBOL( pObject ) )
@@ -1064,9 +1064,9 @@ HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, DISPID* pDispId,
hb_vmRequestReenter() )
{
HB_OLE_PARAM_REF refArray[ 32 ];
int i, ii, iCount, iRefs;
int i, ii, iParams, iCount, iRefs;
iCount = pParams->cArgs;
iParams = iCount = pParams->cArgs;
for( i = iRefs = 0; i < iCount && iRefs < ( int ) HB_SIZEOFARRAY( refArray ); i++ )
{
@@ -1083,8 +1083,11 @@ HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, DISPID* pDispId,
else
hb_vmPushNil();
if( pDispId )
hb_vmPushLong( ( long ) *pDispId );
if( pParam )
{
hb_vmPush( pParam );
iParams++;
}
for( i = 1, ii = 0; i <= iCount; i++ )
{
@@ -1099,12 +1102,10 @@ HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, DISPID* pDispId,
&pParams->rgvarg[ iCount - i ] );
}
if( pDispId )
++iCount;
if( pObject )
hb_vmSend( ( HB_USHORT ) iCount );
hb_vmSend( ( HB_USHORT ) iParams );
else
hb_vmProc( ( HB_USHORT ) iCount );
hb_vmProc( ( HB_USHORT ) iParams );
if( pVarResult )
hb_oleItemToVariant( pVarResult, hb_stackReturnItem() );

View File

@@ -101,6 +101,7 @@ HB_EXTERN_BEGIN
#define HB_IT_ANY ( ( HB_TYPE ) 0xFFFFFFFF )
#define HB_IT_COMPLEX ( ( HB_TYPE ) ( HB_IT_BLOCK | HB_IT_ARRAY | HB_IT_HASH | HB_IT_POINTER | /* HB_IT_MEMVAR | HB_IT_ENUM | HB_IT_EXTREF |*/ HB_IT_BYREF | HB_IT_STRING ) )
#define HB_IT_GCITEM ( ( HB_TYPE ) ( HB_IT_BLOCK | HB_IT_ARRAY | HB_IT_HASH | HB_IT_POINTER | HB_IT_BYREF ) )
#define HB_IT_EVALITEM ( ( HB_TYPE ) ( HB_IT_BLOCK | HB_IT_SYMBOL ) )
#define HB_IT_HASHKEY ( ( HB_TYPE ) ( HB_IT_INTEGER | HB_IT_LONG | HB_IT_DOUBLE | HB_IT_DATE | HB_IT_TIMESTAMP | HB_IT_STRING | HB_IT_POINTER ) )
#if 0
@@ -148,6 +149,7 @@ HB_EXTERN_BEGIN
#define HB_IS_DATETIME( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_DATETIME ) != 0 )
#define HB_IS_COMPLEX( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_COMPLEX ) != 0 )
#define HB_IS_GCITEM( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_GCITEM ) != 0 )
#define HB_IS_EVALITEM( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_EVALITEM ) != 0 )
#define HB_IS_BADITEM( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_COMPLEX ) != 0 && ( HB_ITEM_TYPE( p ) & ~( HB_IT_COMPLEX | HB_IT_MEMOFLAG ) ) != 0 )
#define HB_IS_HASHKEY( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_HASHKEY ) != 0 )
#define HB_IS_OBJECT( p ) ( HB_IS_ARRAY( p ) && HB_ARRAY_OBJ( p ) )
@@ -183,6 +185,7 @@ HB_EXTERN_BEGIN
#define HB_IS_DATETIME( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_DATETIME ) != 0 )
#define HB_IS_COMPLEX( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_COMPLEX ) != 0 )
#define HB_IS_GCITEM( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_GCITEM ) != 0 )
#define HB_IS_EVALITEM( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_EVALITEM ) != 0 )
#define HB_IS_HASHKEY( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_HASHKEY ) != 0 )
#define HB_IS_BADITEM( p ) ( ( HB_ITEM_TYPE( p ) & HB_IT_COMPLEX ) != 0 && ( HB_ITEM_TYPE( p ) & ~( HB_IT_COMPLEX | HB_IT_MEMOFLAG ) ) != 0 )
#define HB_IS_OBJECT( p ) ( HB_IS_ARRAY( p ) && HB_ARRAY_OBJ( p ) )
@@ -216,6 +219,7 @@ HB_EXTERN_BEGIN
#define HB_IS_DATETIME( p ) ( ( HB_ITEM_TYPERAW( p ) & HB_IT_DATETIME ) != 0 )
#define HB_IS_COMPLEX( p ) ( ( HB_ITEM_TYPERAW( p ) & HB_IT_COMPLEX ) != 0 )
#define HB_IS_GCITEM( p ) ( ( HB_ITEM_TYPERAW( p ) & HB_IT_GCITEM ) != 0 )
#define HB_IS_EVALITEM( p ) ( ( HB_ITEM_TYPERAW( p ) & HB_IT_EVALITEM ) != 0 )
#define HB_IS_HASHKEY( p ) ( ( HB_ITEM_TYPERAW( p ) & HB_IT_HASHKEY ) != 0 )
#define HB_IS_BADITEM( p ) ( ( HB_ITEM_TYPERAW( p ) & HB_IT_COMPLEX ) != 0 && ( HB_ITEM_TYPERAW( p ) & ~( HB_IT_COMPLEX | HB_IT_MEMOFLAG | HB_IT_DEFAULT ) ) != 0 )
#define HB_IS_OBJECT( p ) ( HB_IS_ARRAY( p ) && HB_ARRAY_OBJ( p ) )

View File

@@ -2202,7 +2202,6 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
const char * pszPtr;
HB_SIZE ulSize, ulLen;
HB_BYTE * ptr;
PHB_ITEM pError;
HB_ERRCODE errCode;
HB_TRACE(HB_TR_DEBUG, ("hb_dbfPutValue(%p, %hu, %p)", pArea, uiIndex, pItem));
@@ -2477,7 +2476,7 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
/* Exit if any error */
if( errCode != HB_SUCCESS )
{
pError = hb_errNew();
PHB_ITEM pError = hb_errNew();
hb_errPutGenCode( pError, hb_dbfGetEGcode( errCode ) );
hb_errPutDescription( pError, hb_langDGetErrorDesc( hb_dbfGetEGcode( errCode ) ) );
hb_errPutOperation( pError, hb_dynsymName( ( PHB_DYNS ) pField->sym ) );