The following questions tend to be asked regularly on the comp.lang.tcl newsgroup: * ''I have a large [C]/[C++] program, how do I make it scriptable with [Tcl]?'' * ''I have a large C/C++ program, how do I add a [Tk] [GUI] to it?'' At a high level, there are three different solutions to consider. 1. Embed Tcl calls in my C/C++ code. 2. Wrap my C/C++ code to make it callable from Tcl. Replace the C/C++ main() with a tclsh/wish main program 3. Something else ---- '''Embed Tcl Calls in C/C++ code''' While the text "[Why adding Tcl calls to a C/C++ application is a bad idea]" is an interesting dialog concerning the appropriate approach to performing this task, where can one find specific coding examples and documentation regarding what one needs to do, in a C program, if one needs to create an interpreter and then execute tcl commands making use of that interpreter. Well, one example comes ''out of the box'' with both Tcl and Tk. Take a look at the tcl/unix/tclAppInit.c (or tcl/win/tclAppInit.c) files in the tcl source distribution (which is the mainline C module for the tclsh command), and in the Tk source distribution, tk/unix/tkAppInit.c or tk/win/winMain.c (I don't understand why the name difference here...). For MacOS, see tk/mac/tkMacAppInit.c and tk/macosx/tkMacOSXAppInit.c (again, I don't understand the reasoning for file name changes). These provide at least a basic skeleton for initializing an interpreter. Unfortunately, they leave you in an interpretive mode which most people don't want to happen. So another example is needed. I do know there are two kinds of Tcl actions one can invoke from C/C++ Since Tcl is ''just'' a C library, some Tcl actions can be invoked by calling the appropriate Tcl function call. However, some things in Tcl must be done by invoking [Tcl_Eval], after appropriately setting up a Tcl interpreter. Can someone provide some sample C or C++ code that shows setting up the interpreter, then perhaps invoking things each way? A dream scenario would do this for Tcl/Tk since that is a superset of the same kind of request for Tcl... ----