Just upgraded to 3.0.38, but have problem...

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by l3whmg »

Hi guys,
I find the solution: the problems seem to come from nightly version. This version is target as 3.1.x rev. 169.... that is different from official 3.0.0 rev. 16951.
I don't know exactly where is the problem, but I can't find "FREELIBRARY" and "TOLEAUTO" with nightly version.
Cheers
Luigi from Italy
www.L3W.it
User avatar
gfilatov
Posts: 1090
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by gfilatov »

l3whmg wrote:Hi guys,
I find the solution: the problems seem to come from nightly version. This version is target as 3.1.x rev. 169.... that is different from official 3.0.0 rev. 16951.
I don't know exactly where is the problem, but I can't find "FREELIBRARY" and "TOLEAUTO" with nightly version.
Hi Luigi,

You are right ;)

These functions were moved to legacy source of hbwin library and they were erased in the current harbour 3.1.0dev build after cleanup of the legacy codes.

Hope that helps. :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by l3whmg »

Hi Grigory, many thanks for your info. As usual, you are very prepared ;)
Cheers
Luigi from Italy
www.L3W.it
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by Rathinagiri »

Thanks for the info Grigory.

In that case, where can we find these functionalities? Are they modernized and included in Harbour elsewhere?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
gfilatov
Posts: 1090
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by gfilatov »

rathinagiri wrote:...
where can we find these functionalities?
Hi Rathi,

There is a new class WIN_OLEAUTO instead of old TOleAuto() in the Harbour contrib HBWIN library.

You can uncomment also the function FreeLibrary() in the HMG source file c_winapimisc.c as below

Code: Select all

HB_FUNC( FREELIBRARY )
{
   FreeLibrary( (HMODULE) hb_parnl( 1 ) ) ;
}
Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
gfilatov
Posts: 1090
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by gfilatov »

Rathi,

BTW you can look for full source of implementation of class TOleAuto from a new WIN_OLEAUTO below:
#define HB_CLS_NOTOBJECT /* avoid definition of method: INIT */

#include "hbclass.ch"

#include "common.ch"
#include "error.ch"

#define EG_OLEEXCEPTION 1001

STATIC s_bBreak := { | oError | Break( oError ) }

STATIC PROCEDURE Throw( oError )
LOCAL lError := Eval( ErrorBlock(), oError )
IF ! ISLOGICAL( lError ) .OR. lError
__ErrInHandler()
ENDIF
Break( oError )

STATIC FUNCTION ThrowOpError( nSubCode, cOperator, ... )
LOCAL oError

oError := ErrorNew()
oError:Args := { ... }
oError:CanDefault := .F.
oError:CanRetry := .F.
oError:CanSubstitute := .T.
oError:Description := "argument error"
oError:GenCode := EG_ARG
oError:Operation := cOperator
oError:Severity := ES_ERROR
oError:SubCode := nSubCode
oError:SubSystem := "BASE"

RETURN Throw( oError )

CREATE CLASS TOLEAUTO FROM WIN_OLEAUTO
/* TODO: Implement compatibility to the required extent */
VAR cClassName
METHOD New( xOle, cClass )
METHOD hObj( xOle )

METHOD OleValuePlus( xArg ) OPERATOR "+"
METHOD OleValueMinus( xArg ) OPERATOR "-"
METHOD OleValueMultiply( xArg ) OPERATOR "*"
METHOD OleValueDivide( xArg ) OPERATOR "/"
METHOD OleValueModulus( xArg ) OPERATOR "%"
METHOD OleValuePower( xArg ) OPERATOR "^"
METHOD OleValueInc() OPERATOR "++"
METHOD OleValueDec() OPERATOR "--"
METHOD OleValueEqual( xArg ) OPERATOR "="
METHOD OleValueExactEqual( xArg ) OPERATOR "=="
METHOD OleValueNotEqual( xArg ) OPERATOR "!="
ENDCLASS

METHOD hObj( xOle ) CLASS TOLEAUTO

IF PCount() > 0 .AND. xOle != NIL
IF ISNUMBER( xOle )
xOle := __OLEPDISP( xOle )
ENDIF
IF hb_isPointer( xOle )
::__hObj := xOle
ENDIF
ENDIF

RETURN ::__hObj

METHOD New( xOle, cClass ) CLASS TOLEAUTO
LOCAL hOle
LOCAL oError

IF ISNUMBER( xOle )
xOle := __OLEPDISP( xOle )
ENDIF

IF hb_isPointer( xOle )
::__hObj := xOle
IF ISCHARACTER( cClass )
::cClassName := cClass
ELSE
::cClassName := hb_ntos( win_P2N( xOle ) )
ENDIF
ELSEIF ISCHARACTER( xOle )
hOle := __OleCreateObject( xOle )
IF ! Empty( hOle )
::__hObj := hOle
::cClassName := xOle
ELSE
oError := ErrorNew()
oError:Args := hb_AParams()
oError:CanDefault := .F.
oError:CanRetry := .F.
oError:CanSubstitute := .T.
oError:Description := win_OleErrorText()
oError:GenCode := EG_OLEEXCEPTION
oError:Operation := ProcName()
oError:Severity := ES_ERROR
oError:SubCode := -1
oError:SubSystem := "TOleAuto"

RETURN Throw( oError )
ENDIF
ENDIF

RETURN Self

FUNCTION CreateObject( xOle, cClass )
RETURN TOleAuto():New( xOle, cClass )

FUNCTION GetActiveObject( xOle, cClass )
LOCAL o := TOleAuto():New()
LOCAL hOle
LOCAL oError

IF ISNUMBER( xOle )
xOle := __OLEPDISP( xOle )
ENDIF

IF hb_isPointer( xOle )
o:__hObj := xOle
IF ISCHARACTER( cClass )
o:cClassName := cClass
ELSE
o:cClassName := hb_ntos( win_P2N( xOle ) )
ENDIF
ELSEIF ISCHARACTER( xOle )
hOle := __OleGetActiveObject( xOle )
IF ! Empty( hOle )
o:__hObj := hOle
o:cClassName := xOle
ELSE
oError := ErrorNew()
oError:Args := hb_AParams()
oError:CanDefault := .F.
oError:CanRetry := .F.
oError:CanSubstitute := .T.
oError:Description := win_OleErrorText()
oError:GenCode := EG_OLEEXCEPTION
oError:Operation := ProcName()
oError:Severity := ES_ERROR
oError:SubCode := -1
oError:SubSystem := "TOleAuto"

RETURN Throw( oError )
ENDIF
ENDIF

RETURN o

METHOD OleValuePlus( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ::OleValue + xArg
RECOVER
RETURN ThrowOpError( 1081, "+", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueMinus( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ::OleValue - xArg
RECOVER
RETURN ThrowOpError( 1082, "-", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueMultiply( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ::OleValue * xArg
RECOVER
RETURN ThrowOpError( 1083, "*", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueDivide( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ::OleValue / xArg
RECOVER
RETURN ThrowOpError( 1084, "/", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueModulus( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ::OleValue % xArg
RECOVER
RETURN ThrowOpError( 1085, "%", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValuePower( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ::OleValue ^ xArg
RECOVER
RETURN ThrowOpError( 1088, "^", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueInc() CLASS TOLEAUTO

BEGIN SEQUENCE WITH s_bBreak
++::OleValue
RECOVER
RETURN ThrowOpError( 1086, "++", Self )
END SEQUENCE

RETURN Self

METHOD OleValueDec() CLASS TOLEAUTO

BEGIN SEQUENCE WITH s_bBreak
--::OleValue
RECOVER
RETURN ThrowOpError( 1087, "--", Self )
END SEQUENCE

RETURN Self

METHOD OleValueEqual( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ( ::OleValue = xArg ) /* NOTE: Intentionally using '=' operator. */
RECOVER
RETURN ThrowOpError( 1089, "=", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueExactEqual( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ( ::OleValue == xArg )
RECOVER
RETURN ThrowOpError( 1090, "==", Self, xArg )
END SEQUENCE

RETURN xRet

METHOD OleValueNotEqual( xArg ) CLASS TOLEAUTO
LOCAL xRet

BEGIN SEQUENCE WITH s_bBreak
xRet := ( ::OleValue != xArg )
RECOVER
RETURN ThrowOpError( 1091, "!=", Self, xArg )
END SEQUENCE

RETURN xRet
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by Rathinagiri »

Thanks a lot Grigory Filatov. Great!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Just upgraded to 3.0.38, but have problem...

Post by sudip »

Hello Rathi,

I found problem when compiling one of my old projects with 3.0.38
2011-08-04_2126.png
2011-08-04_2126.png (58.19 KiB) Viewed 5080 times
I am not sure, whether I missed something for report library or not.

Thanks.
With best regards,
Sudip
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by danielmaximiliano »

Hi Sudip:
which library you use in your old application??
You can add a portion of the source where the error is generated
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Just upgraded to 3.0.38, but have problem...

Post by Rathinagiri »

East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply