![]() |
|
|
These examples are designed to give Borland users a good start in combining Tcl/TK and C/C++. However, users of other compilers could find them useful, too: All examples consist of either one or maximal two C files. Therefore, if you know how to construct a program (or a DLL / shared library in the case of mk_dll) with your compiler consisting of one or two source files, you should be able to make use of these examples.
Please preserve the directory structure when unzipping the examples - each example contains a specific file readme.txt.
How to extend Tcl with C functions put into a DLL. The example doesn't do
any anything important. It is basically the same as the file example.c found on the
scriptics web site.
Contains a generic makefile for the free Borland compiler - generic in the sense,
that it should be easy to extend it to different (Borland) targets. The makefile is suited
to create a DLL or a .EXE - either as console or as "normal" (GUI) Windows
application. At least this is what I hope.
One of the examples from Brent Welch's book, "Practical Programming in Tcl and Tk". It contains a C++ Builder 5 project file as well as a makefile usable with the free compiler (see readme.txt for details).
This example demonstrates another way to extend Tcl with functions written in C. Here we have a C main which 'registers' additional commands with Tcl and then starts a normal Tcl shell. There you can do whatever is legal in Tcl - but you can also use your additional commands.
This example embeds a Tcl interpreter in a C program, feeds it a (Tcl) script and prints its result. In order to combine several features it also extends Tcl with an own command (implemented like in the tclmain example). In order to test not only the working of the interpreter but at the same time the working of the new command, a sample script 'random.tcl' is provided which activates just this new command (random).
It contains a C++ Builder 5 project file as well as a makefile usable with the free compiler (see readme.txt for details).
We can not only combine Tcl and C, we can also do it with TK. Therefore this example demonstrates setting up a TK application from a main C program and providing functionality written in C to a Tcl/TK script.
This way to integrate Tcl and C is completely different from the other examples. Please note that I have no idea whether all the operations that are performed there are necessary. I got this example upon a call for help in comp.lang.tcl.
It contains a C++ Builder 5 project file as well as a makefile usable with the free compiler (see readme.txt for details).
This, too, is a TK application. In a first step it shows - like other examples - how to extend Tcl/TK with a new command. In a second step it creates a TK window. Not from an external script - like in 'SimpleTK' - but using a different technique.
It contains a C++ Builder 5 project file as well as a makefile usable with the free compiler (see readme.txt for details).
Let's see, how many users are interested in this topic. You are visitor 10653 since Dec. 4, 2000.
Things change fast these days. Want to be informed if changes had been necessary (bugs discovered, new version of ...) or additional material is available (e.g. not only C & Tcl, but also VCL & Tcl) ?
Version info: All examples (if applicable) are based on Tcl/TK 8.3.2, Borland C++ 5.5 (or C++ Builder 5) and MkTclApp 3.9.
Copyright © Helmut Giese, email: hgiese@ratiosoft.com
Parkstr. 41, 34119 Kassel, Tel.: 0561 - 766 59 50, Fax: 0561 - 766 59 51
Königstor 59, 34119 Kassel, Tel.: 0561 - 739 35 30, Fax: 0561 - 739 35 31
Web Design von Bianca Engler: email
internet