Re: Confuse behaviour calling a DLL by Alejandro
Alejandro
Sun Jul 13 17:30:45 CDT 2008
Hi Christof !
Thank you for your memorable patience. I find your analysis very focused.
Indeed I´m using as you said EXECSCRIPT(cmd), but for a few times it works
fine.
The procedure that call the DLL to open a table is:
PROCEDURE use3 && Open tables in MDATA.DLL
PARAMETERS mtable,mindex
#DEFINE EXPRZ0 "DO "
#DEFINE EXPRZ "tablasmain3.prg IN "+xpath+[mdata.]+[dll]
#DEFINE EXPRZ2 " with "+"mtable, mindex"
commd=EXPRZ0+EXPRZ+EXPRZ2 && These strings create an expression as you
said.
EXECSCRIPT(commd)
ENDPROC
**********************************************************
But, I realized this application don´t work in spite of receiving the
fullpath of the dbf. The statement:
DO tablasmain3.prg IN "mdata"+".dll" with
"f:\proyectos\wtriv48\dbf3c\nuevos\autor", "0"
displays the error "File <mydbf> does not exist". The main program of
this DLL is:
**********************************************************
PROCEDURE TABLASMAIN3
PARAMETERS mtabla,mindex <--- takes dbf name and index
PUBLIC xpath
LOCAL lcSys16, lcProgram
lcSys16 = SYS(16)
lcProgram = SUBSTR(lcSys16, AT(":", lcSys16) - 1)
CD LEFT(lcProgram, RAT("\", lcProgram))
IF RIGHT(lcProgram, 3) = "FXP"
CD ..
ENDIF
xpath=FULLPATH(CURDIR())
SET DEFA TO (xpath)
SET PATH TO dbf, class, dbf3c\nuevos, prg
SET CLASSLIB TO xtablas addi
&& Now I create an instance of my opener class with the same 2 parameters
otabla=CREATEOBJECT("basetablas",mtabla,mindex)
ENDPROC
**********************************************************
In the class Basetablas the code is:
**********************************************************
PROCEDURE Init
PARAMETERS mtabla ,mindex
IF NOT USED(mtabla)
USE (mtabla) IN 0 <----- Here comes always the error "File <mydbf>
does not exist". So I think this is not a different former error.
ENDIF
SELECT (mtabla)
IF mindex <>"0"
SET ORDER TO (mindex)
endif
**********************************************************
Thank you for your valuable opinion.
Alejandro