2012-06-17 11:41 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbtip/encoder.prg
  * contrib/hbtip/encqp.prg
    % use hb_default()

  * contrib/hbtip/encqp.prg
    ! fixed RTE when using TIPEncoderQP class from a dynamically loaded hbtip.
      It has been reported long time ago, so now I hacked a local
      solution which simply removes inherition from this class,
      which works around the problem. Hopefully the core can get
      the fixes to allow derived classes to be used from dynamic libs
      and this can be reverted. In this case only one variable was
      inherited, so it was easy to do. BTW I was trying to use hb_MailAssemble()
      from a script which triggered this.
      TOFIX: Self contained example (tested on win/mingw):
             --- hbmk2 test.hb
             #require "hbtip"
             PROCEDURE Main()
                TIPEncoderBase64():New()
             --- ->
             Error BASE/3003  Cannot find super class 'TIPENCODER': __CLSINSTSUPER
             Called from __CLSINSTSUPER(0)
             Called from HBCLASS:CREATE(0)
             Called from TIPENCODERBASE64(0)
             ---
This commit is contained in:
Viktor Szakats
2012-06-17 09:45:54 +00:00
parent 9a8f43c273
commit 0eae4ae2fc
3 changed files with 36 additions and 7 deletions

View File

@@ -16,6 +16,32 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-06-17 11:41 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbtip/encoder.prg
* contrib/hbtip/encqp.prg
% use hb_default()
* contrib/hbtip/encqp.prg
! fixed RTE when using TIPEncoderQP class from a dynamically loaded hbtip.
It has been reported long time ago, so now I hacked a local
solution which simply removes inherition from this class,
which works around the problem. Hopefully the core can get
the fixes to allow derived classes to be used from dynamic libs
and this can be reverted. In this case only one variable was
inherited, so it was easy to do. BTW I was trying to use hb_MailAssemble()
from a script which triggered this.
TOFIX: Self contained example (tested on win/mingw):
--- hbmk2 test.hb
#require "hbtip"
PROCEDURE Main()
TIPEncoderBase64():New()
--- ->
Error BASE/3003 Cannot find super class 'TIPENCODER': __CLSINSTSUPER
Called from __CLSINSTSUPER(0)
Called from HBCLASS:CREATE(0)
Called from TIPENCODERBASE64(0)
---
2012-06-17 11:23 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbtip/encqp.prg
* contrib/hbtip/hbtip.hbx

View File

@@ -65,9 +65,7 @@
FUNCTION TIp_GetEncoder( cModel )
LOCAL oEncoder
IF ! HB_ISSTRING( cModel )
cModel := "as-is"
ENDIF
hb_default( @cModel, "as-is" )
cModel := Lower( cModel )
@@ -101,9 +99,7 @@ CREATE CLASS TIPEncoder
ENDCLASS
METHOD New( cModel ) CLASS TIPEncoder
IF ! HB_ISSTRING( cModel )
cModel := "as-is"
ENDIF
hb_default( @cModel, "as-is" )
::cName := cModel
RETURN Self

View File

@@ -52,7 +52,14 @@
#include "hbclass.ch"
CREATE CLASS TIPEncoderQP FROM TIPEncoder
/* TOFIX: Removed TIPEncode as parent class to make it
work from a dynamically loaded hbtip library.
'VAR cName' was the only inherited item/logic.
This should be reverted once derived classes
work fine from dynamically loaded libs. */
CREATE CLASS TIPEncoderQP
VAR cName
METHOD New() CONSTRUCTOR
METHOD Encode( cData )
METHOD Decode( cData )