Error when calling functions from dclip1.lib

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Error when calling functions from dclip1.lib

#1 Post by c-tec »

Hello,
I have problems implementing functions from dclip1.lib. I need the function dc_interpret(), but when I put this function in my code, the exe does not start, crashes with a fatal error when calling DbeLoad(). What could interfer with dclip1.lib in my appliations ?
regards
Rudolf

Code: Select all

FUNCTION Main ( cParam1, cParam2 )
******************************************************************
DEFAULT cParam1 to ""
DEFAULT cParam2 to ""

  IF ! DbeLoad( "CDXDBE",.T.) // !!!!!!!!!!!!!!!! crash
     Alert( "Database-Engine CDXDBE not loaded" , {"OK"} )
  ENDIF

  IF ! DbeBuild( "DBFCDX", "DBFDBE", "CDXDBE" )
     Alert( "DBFCDX Database-Engine;Could not build engine" , {"OK"} )
  ENDIF




Code: Select all

FATAL ERROR LOG 
No continue after this Error!
SYS Thread-ID: 772 
Module: EXE
Error Codes: EH: 10 Sub: 0(0) OS: 0 XPP: 0
Call Stack of Thread 1 (772):
MAIN(28)
Call Stack of GUI Thread (964):
File: V:\FormCommander\FormCommander.exe
TimeStamp: 20110317 09:57
End of FATAL ERROR LOG.
FATAL ERROR LOG 
No continue after this Error!
SYS Thread-ID: 772 
Module: EXE
Error Codes: EH: 10 Sub: 0(0) OS: 0 XPP: 0
Call Stack of Thread 1 (772):
MAIN(28)
Call Stack of GUI Thread (964):
File: V:\FormCommander\FormCommander.exe
TimeStamp: 20110317 09:58
End of FATAL ERROR LOG.
FATAL ERROR LOG 
No continue after this Error!
SYS Thread-ID: 776 
Module: EXE
Error Codes: EH: 10 Sub: 0(0) OS: 0 XPP: 0
Call Stack of Thread 1 (776):
MAIN(28)
Call Stack of GUI Thread (964):
File: v:\FormCommander\FormCommander.exe
TimeStamp: 20110317 09:58
End of FATAL ERROR LOG.
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Error when calling functions from dclip1.lib

#2 Post by c-tec »

Hello,
this is a little sample, if I remove the function dc_interpret(), the program starts normal. Otherwise I get the erroressage. There are no old eXPress++ libs or so installed. And it occurs with all versions of XBase++ and eXPress++, not only with SL1.
regards
Rudolf

Code: Select all

FUNCTION Main ( cParam1, cParam2 )
******************************************************************
  IF ! DbeLoad( "CDXDBE",.T.)
     Alert( "Database-Engine CDXDBE not loaded" , {"OK"} )
  ENDIF

  IF ! DbeBuild( "DBFCDX", "DBFDBE", "CDXDBE" )
     Alert( "DBFCDX Database-Engine;Could not build engine" , {"OK"} )
  ENDIF

  IF ! DbeLoad( "FOXDBE",.T.)
     Alert( "Database-Engine FOXDBE not loaded" , {"OK"} )
  ENDIF

  IF ! DbeBuild( "FOXCDX", "FOXDBE", "CDXDBE" )
     Alert( "FOXCDX Database-Engine;Could not build engine" , {"OK"} )
  ENDIF

progmain()
RETURN nil

FUNCTION ITEST()
******************************************************************
DC_Interpret(MemoRead('XSAMPLE.TXT'))
return .t.

FUNCTION progmain()
******************************************************************
dc_msgbox("Start ok")
return .t.

Code: Select all

//
// TEST.EXE Project - Definition
//

[PROJECT]
    COMPILE       = xpp
    COMPILE_FLAGS =  /q /b /p /n /w
    DEBUG         = yes
    GUI           = yes
    LINKER        = alink
    LINK_FLAGS    = /DE
    RC_COMPILE    = arc
    RC_FLAGS      = -v
    TEST.XPJ

[TEST.XPJ]
    TEST.EXE

[TEST.EXE]
// $START-AUTODEPEND

// $STOP-AUTODEPEND
test.obj
\alaska19\EXP19\lib\DCLIPX.LIB
\alaska19\EXP19\lib\DCLIP1.LIB
\alaska19\xbtw32\LIB\XBTBASE1.LIB
\alaska19\xbtw32\LIB\XBTBASE2.LIB
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error when calling functions from dclip1.lib

#3 Post by rdonnay »

Rudolf -

This is because the _DCINIT.PRG program in DCLIP1.DLL has an INIT PROC that loads all DBEs, so they can be available at the dot-prompt or by the interpreter.

Xbase++ (in my opinion) has always had a bug in the DBE system.
DbeLoad() causes an error if a DBE is already loaded, when trying to load it.

I ALWAYS test first to see if a DBE is loaded before trying to load it.

Change your code to this:

Code: Select all

FUNCTION Main ( cParam1, cParam2 )
******************************************************************

LOCAL aDbeList := DbeList()

  IF !'CDXDBE' $ aDbeList .AND. ! DbeLoad( "CDXDBE",.T.)
     Alert( "Database-Engine CDXDBE not loaded" , {"OK"} )
  ENDIF

  IF !'CDXDBE' $ ! DbeBuild( "DBFCDX", "DBFDBE", "CDXDBE" )
     Alert( "DBFCDX Database-Engine;Could not build engine" , {"OK"} )
  ENDIF

  IF !'FOXDBE' $ ! DbeLoad( "FOXDBE",.T.)
     Alert( "Database-Engine FOXDBE not loaded" , {"OK"} )
  ENDIF

  IF 'FOXDBE' $ ! DbeBuild( "FOXCDX", "FOXDBE", "CDXDBE" )
     Alert( "FOXCDX Database-Engine;Could not build engine" , {"OK"} )
  ENDIF

progmain()
RETURN nil
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Error when calling functions from dclip1.lib

#4 Post by c-tec »

Hello Roger,
thank you, problem solved, got all working now.
Now I would like to convert all data from DBFCDX to FOXCDX. Your function dc_datatcovert should this do. I think I only have to convert the DBT files to FPT.
But with dc_dataconvert('ALL','DBFCDX','FOXCDX','.DBT') I get an eXPress++ errormessage "DBE buil name already in user" (B)INIT:_DCINIT(28).
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply