From bf906d24641ff7c2ec67263011ebf96edc239da3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 19 Aug 2009 14:46:50 +0000 Subject: [PATCH] 2009-08-19 16:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/legacy.prg ! Deleted pointer to numeric conversions. This means even code using compatibility interface may have to be slightly adapted to use this version of Harbour. Checks like ISNUMBER( CreateOLEObject() ) and CreateOLEObject() == 0 will have to be changed to Empty( CreateOLEObject() ). This stays compatible with other Harbour versions and implementations. Methods/Functions accepting numeric pointers in old implementation will only accept pointers aquired from appropriate OLE API functions. --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/hbwin/legacy.prg | 19 +++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 790581978d..0c7bd870e7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-19 16:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/legacy.prg + ! Deleted pointer to numeric conversions. + This means even code using compatibility interface may + have to be slightly adapted to use this version of Harbour. + Checks like ISNUMBER( CreateOLEObject() ) and CreateOLEObject() == 0 + will have to be changed to Empty( CreateOLEObject() ). This + stays compatible with other Harbour versions and implementations. + Methods/Functions accepting numeric pointers in old implementation + will only accept pointers aquired from appropriate OLE API functions. + 2009-08-19 15:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbwin/olecore.c ! updated for POCC/WinCE header files diff --git a/harbour/contrib/hbwin/legacy.prg b/harbour/contrib/hbwin/legacy.prg index 8531dd9afd..e8ab1a645a 100644 --- a/harbour/contrib/hbwin/legacy.prg +++ b/harbour/contrib/hbwin/legacy.prg @@ -73,6 +73,8 @@ STATIC PROCEDURE Throw( oError ) Break( oError ) RETURN +/* NOTE: xOle with numeric pointers isn't supported by this + implementation. */ CREATE CLASS TOLEAUTO FROM WIN_OLEAUTO /* TODO: Implement compatibility to the required extent */ VAR cClassName @@ -83,9 +85,6 @@ ENDCLASS METHOD hObj( xOle ) CLASS TOLEAUTO IF PCount() > 0 .AND. xOle != NIL - IF ISNUMBER( xOle ) - xOle := win_N2P( xOle ) - ENDIF IF hb_isPointer( xOle ) ::__hObj := xOle ENDIF @@ -97,10 +96,6 @@ METHOD New( xOle, cClass ) CLASS TOLEAUTO LOCAL hOle LOCAL oError - IF ISNUMBER( xOle ) - xOle := win_N2P( xOle ) - ENDIF - IF hb_isPointer( xOle ) ::__hObj := xOle IF ISCHARACTER( cClass ) @@ -140,10 +135,6 @@ FUNCTION GetActiveObject( xOle, cClass ) LOCAL hOle LOCAL oError - IF ISNUMBER( xOle ) - xOle := win_N2P( xOle ) - ENDIF - IF hb_isPointer( xOle ) o:__hObj := xOle IF ISCHARACTER( cClass ) @@ -175,8 +166,12 @@ FUNCTION GetActiveObject( xOle, cClass ) RETURN o +/* NOTE: This will return a pointer type, as opposed to the old + implementation which returned a numeric one. Since this + is a GC collected pointer, there is no way to convert it + to numeric and later reconvert to pointer. */ FUNCTION CreateOLEObject( ... ) - RETURN win_P2N( __OleCreateObject( ... ) ) + RETURN __OleCreateObject( ... ) CREATE CLASS Win32Prn FROM WIN_PRN ENDCLASS