diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 700db9605b..c52940d502 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,25 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-18 02:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbvm.h + * harbour/src/vm/hvm.c + + added new C function hb_vmIsActive() + + * harbour/src/rtl/memvarhb.prg + ! fixed procedure returning value + ! store only simple variables in HB_MVSAVE() just like __MSAVE() + Possible extension: add option to store also NIL, arrays, hashes + and maybe object variables. + ! restore variables in HB_MVRESTORE() as private ones just like + __MVRESTORE() + + * harbour/contrib/hbwin/oleinit.c + * harbour/contrib/hbwin/olecore.c + * updated to compile and link in WinCE builds. Now code using OLE + can be linked with MinGWCE builds without any errors but I have + no idea if it works. Can someone check it? + 2010-15-17 17:29 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/doc/en/class_hbqplaintextedit.txt * contrib/hbqt/hbqt_hbqplaintextedit.cpp diff --git a/harbour/contrib/hbwin/olecore.c b/harbour/contrib/hbwin/olecore.c index c820ec5f42..bcf9d42414 100644 --- a/harbour/contrib/hbwin/olecore.c +++ b/harbour/contrib/hbwin/olecore.c @@ -1250,6 +1250,9 @@ HB_FUNC( __OLECREATEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ HB_FUNC( __OLEGETACTIVEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ { +#if defined( HB_OS_WIN_CE ) + hb_oleSetError( E_NOTIMPL ); +#else BSTR wCLSID; IID ClassID, iid = IID_IDispatch; IDispatch* pDisp = NULL; @@ -1297,6 +1300,7 @@ HB_FUNC( __OLEGETACTIVEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */ hb_oleItemPut( hb_stackReturnItem(), pDisp ); else hb_ret(); +#endif } @@ -1404,6 +1408,7 @@ HB_FUNC( WIN_OLEERRORTEXT ) case E_OUTOFMEMORY: hb_retc_const( "E_OUTOFMEMORY" ); break; case E_INVALIDARG: hb_retc_const( "E_INVALIDARG" ); break; case E_UNEXPECTED: hb_retc_const( "E_UNEXPECTED" ); break; + case E_NOTIMPL: hb_retc_const( "E_NOTIMPL" ); break; case DISP_E_UNKNOWNNAME: hb_retc_const( "DISP_E_UNKNOWNNAME" ); break; case DISP_E_UNKNOWNLCID: hb_retc_const( "DISP_E_UNKNOWNLCID" ); break; case DISP_E_BADPARAMCOUNT: hb_retc_const( "DISP_E_BADPARAMCOUNT" ); break; diff --git a/harbour/contrib/hbwin/oleinit.c b/harbour/contrib/hbwin/oleinit.c index 83f83d75b8..2a721c0167 100644 --- a/harbour/contrib/hbwin/oleinit.c +++ b/harbour/contrib/hbwin/oleinit.c @@ -67,7 +67,11 @@ static void hb_ole_exit( void* cargo ) if( s_iOleInit ) { +#if defined( HB_OS_WIN_CE ) + CoUninitialize(); +#else OleUninitialize(); +#endif s_iOleInit = 0; } } @@ -78,7 +82,11 @@ HB_BOOL hb_oleInit( void ) if( ! s_iOleInit ) { +#if defined( HB_OS_WIN_CE ) + fResult = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ) == S_OK; +#else fResult = OleInitialize( NULL ) == S_OK; +#endif if( fResult ) { hb_vmAtQuit( hb_ole_exit, NULL ); diff --git a/harbour/include/hbvm.h b/harbour/include/hbvm.h index 8f9af5b975..fe52887035 100644 --- a/harbour/include/hbvm.h +++ b/harbour/include/hbvm.h @@ -129,6 +129,7 @@ extern HB_EXPORT void hb_vmRequestEndProc( void ); extern HB_EXPORT HB_USHORT hb_vmRequestQuery( void ); extern HB_EXPORT HB_BOOL hb_vmRequestReenter( void ); extern HB_EXPORT void hb_vmRequestRestore( void ); +extern HB_EXPORT HB_BOOL hb_vmIsActive( void ); /* Return values of hb_vmRequestQuery() */ #define HB_QUIT_REQUESTED 1 /* immediately quit the application */ diff --git a/harbour/src/rtl/memvarhb.prg b/harbour/src/rtl/memvarhb.prg index 09ab3ac33d..d2596438cc 100644 --- a/harbour/src/rtl/memvarhb.prg +++ b/harbour/src/rtl/memvarhb.prg @@ -101,7 +101,7 @@ PROCEDURE HB_MVSAVE( cFileName, cMask, lIncludeMask ) nCount := __mvDbgInfo( nScope ) FOR tmp := 1 TO nCount xValue := __mvDbgInfo( nScope, tmp, @cName ) - IF !( cName == "GETLIST" ) + IF ValType( xValue ) $ "CNDTL" lMatch := hb_WildMatchI( cMask, cName ) IF iif( lIncludeMask, lMatch, ! lMatch ) AAdd( aVars, { Upper( cName ), xValue } ) @@ -153,7 +153,7 @@ PROCEDURE HB_MVSAVE( cFileName, cMask, lIncludeMask ) Eval( ErrorBlock(), oError ) ENDIF - RETURN NIL + RETURN FUNCTION HB_MVRESTORE( cFileName, lAdditive, cMask, lIncludeMask ) LOCAL item @@ -247,14 +247,11 @@ FUNCTION HB_MVRESTORE( cFileName, lAdditive, cMask, lIncludeMask ) IF xValue == NIL xValue := item[ 2 ] ENDIF - IF __MVExist( cName ) - &cName := item[ 2 ] - ELSE - PUBLIC &cName := item[ 2 ] - ENDIF + &cName := item[ 2 ] ENDIF ENDIF NEXT + __MVSETBASE() ENDIF RETURN xValue diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index f4bd8d588a..0497f60ba9 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -8619,6 +8619,13 @@ void hb_vmRequestRestore( void ) hb_stackPopReturn(); } +HB_BOOL hb_vmIsActive( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_vmIsActive()")); + + return s_fHVMActive; +} + PHB_CODEPAGE hb_vmCDP( void ) { HB_STACK_TLS_PRELOAD