Re: Using a tcl interpreter inside a DLL?
- From: "thelfter@xxxxxxxxx" <thelfter@xxxxxxxxx>
- Date: Thu, 29 Nov 2007 10:56:52 -0800 (PST)
On Nov 29, 12:43 pm, jmbussat <jmbus...@xxxxxxxxx> wrote:
Hi,
My DLL code contains:
/* Create the interpreter */
interp = Tcl_CreateInterp();
if(interp==NULL){
LDialog_AlertBox("Can't create TCL interpreter");
return;
}
/* Initialize TCL */
if (Tcl_Init(interp) == TCL_ERROR) {
//fprintf(stderr, "Tcl_Init failed: %s\n", interp->result);
sprintf(str,"Tcl_Init failed: %s\n", interp->result);
LDialog_AlertBox(str);
return;
}
The LDialog() functions are basic message boxes from the
application the DLL gets loaded in. I know for sure that
Tcl_CreateInterp() doesn't return NULL and that the
problem is when Tcl_Init gets executed. During my first
attempt, Tcl_Init was complaining that it couldn't find
init.tcl but now that I have defined the environment
variable TCL_LIBRARY, the call to Tcl_Init causes the
application that loads the DLL to say that there has been
an "Access violation".
The application I am using is L-Edit from Tanner EDA (it's
a IC layout editor - it has some basic annoying GUI and
scripting functions that I would like to improve using
Tcl/Tk).
Am I supposed to use Tcl_FindExecutable()? because my Linux
test program doesn't use it. I have tried my code as a standalone
program on Linux but I am going to try to see what happens if I
make a dynamic library and then try to use it in another program.
I'm thinking that I must have to do something else to give some
"space" to tcl for it to work...
Thanks for your help.
On Nov 29, 7:51 am, Donald G Porter <d...@xxxxxxxx> wrote:
jmbussat wrote:
I tried to reuse some Linux based code where I use tcl/tk from inside
a
C program that dynamically creates tcl code that gets interpreted by
the
interpreter (!) but I can't go past the Tcl_Init() step without
crashing my
application.
Is your program missing a call to Tcl_FindExecutable()?
When you say "crash," precisely what do you mean? Do you get
an error message? What is it?
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.por...@xxxxxxxx Information Technology Laboratory |
|http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
This is more appropriate for a modern Tcl Interpreter.
if (Tcl_Init(interp) != TCL_OK) {
fprintf(STDERR,
"Tcl_Init: %s",
Tcl_GetStringResult(interp));
return;
}
.
- Follow-Ups:
- Re: Using a tcl interpreter inside a DLL?
- From: Mark Janssen
- Re: Using a tcl interpreter inside a DLL?
- References:
- Using a tcl interpreter inside a DLL?
- From: jmbussat
- Re: Using a tcl interpreter inside a DLL?
- From: Donald G Porter
- Re: Using a tcl interpreter inside a DLL?
- From: jmbussat
- Using a tcl interpreter inside a DLL?
- Prev by Date: Re: Using a tcl interpreter inside a DLL?
- Next by Date: Re: passing tcl list to args of an external program
- Previous by thread: Re: Using a tcl interpreter inside a DLL?
- Next by thread: Re: Using a tcl interpreter inside a DLL?
- Index(es):
Relevant Pages
|