Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interpreter closes when called from within C

Status
Not open for further replies.

japskar

Programmer
Feb 13, 2002
27
0
0
Hi,
I'm trying to get a GUI on my screen using a TCL/TK script called from C.
So far, no problem as long as I use "tkwait window ." so that my GUI knows that it needs to stay alive as long as the user didn't close it.
However, I often get error messages from TCL83.DLL or KERNEL32.DLL when passing data between C and Tcl.
Although this bothers me, my greatest frustration is, for example, when I press an exitbutton, I get the error:

bgerror failed to handle background error.
Original error:
Error in bgerror: attempt to call eval in deleted interpreter.

And all I do is call a script from C containing:

pack [label .l1 -text {this is a test}];
pack [button .b1 -text {Ok} -command {exit};
tkwait window .

Can someone tell me where I go wrong?

Best regards,
Jasper van Dijk
 
Hmm... more strange behaviour:

pack [label .l1 -text {this is text}];
pack [button .b1 -text {Ok} -command {destroy .}];
tkwait window .

causes an invalid page fault in TCL83.DLL when clicking the OK button.

When run in wish it works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top