Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/Access-violation-with-Tcl-EvalFIle.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Access violation with Tcl_EvalFIle

Posted by jane (jane), 19 April 2005
Hi all,
I am not sure whether this is the right place to post this. If this post fits here, please help me. If I this is not the place, please point me to the right place.

I am very new to Tcl programming world.
I am trying to implement a TCL command in C.
Before that I wanted to try out a small experiment given in a book. But I am  getting an access violation(system error) when I invoke Tcl_EvalFile. If I use Tcl_Eval with same command, then it works just fine. Somebody please hel
p me.
This is on Windows XP platform.

Thanks a lot in advance.

This is the code:

int main()
{
Tcl_Interp *myInterp;
int retCode;
char name[] = "./simple.tcl";

myInterp = Tcl_CreateInterp();

retCode = Tcl_EvalFile(myInterp, name); // Access Violation
if(retCode != TCL_OK)
fprintf(stdout, "Error\n");

return 1;
}

contents of simple.c are : puts Hello.

- Jane

Posted by admin (Graham Ellis), 20 April 2005
I can't spot anything straight away (but it just might be staring me in the face!).  The best I can suggest is try the examples that we'ver got at http://www.wellho.net/resources/T243.html which are pretty similar; if they work, then you can play "spot the difference" and if not then I can have a further look.  Also - do you have access to a "nix" operating system to test / see if your code works there.   A further thought - which C compiler are you using on the Microsoft system, and were the Tcl libraries compiled under the SAME compiler?  If not, that's a possible compatabilty issue.

Posted by jane (jane), 20 April 2005
Thanks for the reply, Graham. I figured out what the problem was. I called Tcl_FindExecutable before calling Tcl_EvalFile and it works now. Thanks once again for your time



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho