diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 10adaeaeac..bfb5e863fb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,19 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-01 23:52 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbfbird/firebird.c + ! Added ugly hack to make it compile with Firebird 2.1.1 + and BCC 5.8.2 (and upper). + This way all Win32/Win64 builds are now supporting + this newer version of Firebird. DOS still needs 2.0.4. + + * contrib/hbwin/win_tole.prg + * contrib/hbwin/win_ole.c + + Added support for optional License Key. + Borrowed from xhb/Ron Pinkas. + (untested) + 2008-10-01 14:46 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbct/ctmisc.prg ! Fix to CENTER() when 3rd param is logical. diff --git a/harbour/contrib/hbfbird/firebird.c b/harbour/contrib/hbfbird/firebird.c index 23558e8aa7..3fc4c3a55a 100644 --- a/harbour/contrib/hbfbird/firebird.c +++ b/harbour/contrib/hbfbird/firebird.c @@ -57,6 +57,13 @@ #define HB_OS_WIN_32_USED +/* NOTE: Ugly hack to avoid this error when compiler with BCC 5.8.2 and above: + Error E2238 C:\...\Firebird-2.1.1\include\ibase.h 82: Multiple declaration for 'intptr_t' */ +#if ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 ) + /* Prevent inclusion of from hbdefs.h */ + #define __STDINT_H +#endif + #include "hbapi.h" #include "hbapiitm.h" diff --git a/harbour/contrib/hbwin/win_ole.c b/harbour/contrib/hbwin/win_ole.c index 85b138f400..7573b55376 100644 --- a/harbour/contrib/hbwin/win_ole.c +++ b/harbour/contrib/hbwin/win_ole.c @@ -1380,7 +1380,7 @@ HB_FUNC( MESSAGEBOX ) } /* ----------------------------------------------------------------------- */ -HB_FUNC( CREATEOLEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ +HB_FUNC( CREATEOLEOBJECT ) /* ( cOleName | cCLSID [, cIID ] [, cLicense ] ) */ { BSTR bstrClassID; IID ClassID, iid; @@ -1401,7 +1401,7 @@ HB_FUNC( CREATEOLEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ /*HB_TRACE(HB_TR_INFO, ("Result: %p\n", s_nOleError));*/ - if( hb_pcount() == 2 ) + if( ISCHAR( 2 ) ) { if( hb_parcx( 2 )[ 0 ] == '{' ) { @@ -1417,9 +1417,28 @@ HB_FUNC( CREATEOLEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ if( SUCCEEDED( s_nOleError ) ) { - /*HB_TRACE(HB_TR_INFO, ("Class: %i\n", ClassID));*/ - s_nOleError = CoCreateInstance( HB_ID_REF( REFCLSID, ClassID ), NULL, CLSCTX_SERVER, (REFIID) riid, &pDisp ); - /*HB_TRACE(HB_TR_INFO, ("Result: %p\n", s_nOleError));*/ + if( ISCHAR( 3 ) ) + { + IClassFactory2 * pCF; + + s_nOleError = CoGetClassObject( HB_ID_REF( REFCLSID, ClassID ), CLSCTX_SERVER, NULL, (LPIID) &IID_IClassFactory2, (LPVOID *) &pCF ); + + if( SUCCEEDED( s_nOleError ) ) + { + BSTR bstrLic = hb_oleAnsiToSysString( hb_parc( 3 ) ); + + s_nOleError = pCF->lpVtbl->CreateInstanceLic( pCF, NULL, NULL, riid, bstrLic, &pDisp ); + + SysFreeString( bstrLic ); + pCF->lpVtbl->Release( pCF ); + } + } + else + { + /*HB_TRACE(HB_TR_INFO, ("Class: %i\n", ClassID));*/ + s_nOleError = CoCreateInstance( HB_ID_REF( REFCLSID, ClassID ), NULL, CLSCTX_SERVER, (REFIID) riid, &pDisp ); + /*HB_TRACE(HB_TR_INFO, ("Result: %p\n", s_nOleError));*/ + } } hb_retnl( ( LONG ) pDisp ); diff --git a/harbour/contrib/hbwin/win_tole.prg b/harbour/contrib/hbwin/win_tole.prg index b3b9d32f4b..722d663292 100644 --- a/harbour/contrib/hbwin/win_tole.prg +++ b/harbour/contrib/hbwin/win_tole.prg @@ -50,11 +50,11 @@ */ #ifndef __PLATFORM__WINDOWS - Function CreateObject() - Return NIL + FUNCTION CreateObject() + RETURN NIL FUNCTION GetActiveObject() - Return NIL + RETURN NIL #else #define HB_CLS_NOTOBJECT @@ -87,9 +87,9 @@ RETURN //----------------------------------------------------------------------------// -FUNCTION CreateObject( cString ) +FUNCTION CreateObject( cString, cLicense ) -RETURN TOleAuto():New( cString ) +RETURN TOleAuto():New( cString, , cLicense ) //----------------------------------------------------------------------------// @@ -99,7 +99,7 @@ RETURN TOleAuto():GetActiveObject( cString ) //----------------------------------------------------------------------------// -init PROCEDURE HB_OleInit() +INIT PROCEDURE HB_OleInit() /* It's important to store value returned by __HB_OLE_INIT() in * STATIC variable. When HVM will clear STATICs on HVM exit @@ -163,7 +163,7 @@ CLASS TOleAuto DATA cClassName DATA pOleEnumerator - METHOD New( uObj, cClass ) CONSTRUCTOR + METHOD New( uObj, cClass, cLicense ) CONSTRUCTOR METHOD GetActiveObject( cClass ) CONSTRUCTOR METHOD Invoke() @@ -209,7 +209,7 @@ CLASS TOleAuto ENDCLASS //-------------------------------------------------------------------- -METHOD New( uObj, cClass ) CLASS TOleAuto +METHOD New( uObj, cClass, cLicense ) CLASS TOleAuto LOCAL oErr @@ -219,7 +219,7 @@ METHOD New( uObj, cClass ) CLASS TOleAuto ENDIF IF ValType( uObj ) == 'C' - ::hObj := CreateOleObject( uObj ) + ::hObj := CreateOleObject( uObj, , cLicense ) IF OleError() != 0 IF Ole2TxtError() == "DISP_E_EXCEPTION"