From: Alexandre Ferrieux on
On Feb 2, 11:32 am, Exchange CAPITALS for correct address
<Slaus.Keegeba...(a)gmx.de> wrote:
>
> Alex, i appreciate any help, i can get. But throwing in some
> impressive phrases, which demonstrate, that You are the absolute
> expert will help me as much as Jans proposal to rewrite all programs
> in Tcl.

Sorry, did my best to hilight the important questions. If it gets
emotional this fast, I prefer to give up. Fare well !

> With my knowledge of Tcl! This is not a playground programm,
> where i can only destroy some bytes, there is a real machine behind
> this program which can easily make half a million of bucks damage.

Ah, what kind of company is that, where a Tcl newbie is assigned the
Tcl port of such a serious thing...
Defense ? Nuclear power plant ? Chilling...

-Alex
From: nedbrek on
Hello,

"Exchange CAPITALS for correct address" <Slaus.Keegebarth(a)gmx.de> wrote in
message news:7vvem5huou17rgledrkumuhbqup3plblv7(a)4ax.com...
> On Mon, 1 Feb 2010 08:14:19 -0500, "nedbrek" <nedbrek(a)yahoo.com>
> wrote:
>>>>Then that init function is called. Whatever else you do, make sure to
>>>>create a new command ("mycmd"), and attach whatever state you need with
>>>>it.
>
> I read about this function (i also saw,that i should include tcl.h),
> but once again i do not have the smallest idea, where to get it.

"mycmd" is just an example. It is whatever you pass in as the second
argument to Tcl_CreateObjCommand
Tcl_CreateObjCommand(interp, "mycmd", myCallback, NULL, NULL);

Ned


From: Exchange CAPITALS for correct address on
On Wed, 03 Feb 2010 19:46:28 +0100, Jan Kandziora <jjj(a)gmx.de> wrote:

>Sockets + pure Tcl library. Or other things that are already in the Tcl
>development kit. Things other people already developed and put it into the
>environment.

I do not know, how i can use sockets in Tcl. I use built-in TCP as an
intermediate solution. But i need UDP as well. And the acces to
my customers database is only available as a Win32-DLL or as a
Linux-so. Although this itself uses TCP, i am not allowed to do so.
This is why i made my question for help. I am using Tcl-Coach, which
is very nice environment to start with Tcl. It has a good tutorial ( i
think in german only), but i did not find any extensions until now.
Even the file tcl.h, which i would need according to Neds proposal is
not there. But it can do standalone executables, which is necessary
for me.

>Fine thing. Use ffidl, like Alex told you.

Repeating buzzwords does not help. As i told, i had already searched
the internet before, and had found things like ffidl, swig and
serveral more, where i do not remember the names.
As i stated in my first posting, these things are all looking too
complicated to be used by me. Maybe You can give me a hint, how i have
to use them. Alex already felt offended, when in my despair i asked
him to clarify the use of ffidl. Putting some punctuation and
parentheses around the buzzwords only looks arrogant to me.
Sorry if this is too rude, i do not know how to express this more
kindly, the german word is "verscheissern", but babelfish and my
dictionary both do not know this word.
But i should not complain, it is the fate of the beginners to be the
destination of bad jokes.

Nevertheless there _must_ be a way, to access dynamic libraries. ffidl
does this, so maybe i have to dig through the sources of ffidl to find
the basics. Each and every computer language i have used so far, has a
possibility to access the underlying OS. Otherwise it is seriously
crippled. If i can not get Tcl to do this, it goes to the trashcan. My
brain is already proposing this since some time. Its only my heart,
which says: give Tcl one more try.


>Does not compute. You won't get any benefit from Tcl being available on both
>platforms if your program relies on platform-specific libraries. You could
>have said "I'd like to use C++ because it supports Linux, too.".

This seems to be the basic wrong assumption, You are making FMPOV.
I rely on on platform-specific libraries, which are available on Win32
as on Linux (and DOS and Mac-OS and and... ). Look for the
IP-Interface as an example. It is made by a system-DLL on Windows,
which comes with Windows, so it is clearly a system DLL. But it
presents the same interface to the user as Linux does (and how i have
used it on DOS, where it was an external program). So for to the lower
side (to the system) they are different (platform-specific), but to
the upper side (to the user or calling program or however You call it)
they are more ore less identical. Not totally, but rather. And the
necessary call to WSAstartup() can be done by providing an empty
routine on Linux without too much effort :-)

This is, what _i_ call portability. An underlying abstraction layer,
which gives me the same functionality on all systems. My programs are
running equally on DOS and on Win32, all i had to change, is the
mechanism of calling. In DOS, i had to link a static library, in Win32
i can choose, if i link statically or load dynamic. The names of the
routines and the arguments are all identical, even the errorcodes.

Maybe ffidl can give me, what i need. But ffidl has to use some
underlying mechanism to acess the system. And this is what i need to
learn first. Then i can use ffidl as an upgrade. I do not want
"muddling through" ( "Hey, my work is so secret that i myself do not
know, what i am doing here!"). I know that a lot of people like this
approach. I do not.

Thanks for Your efforts and kind regards

Klaus

P.S. kindness is _never_ futile, it always makes the world better.
From: Exchange CAPITALS for correct address on
On Wed, 3 Feb 2010 06:25:59 -0500, "nedbrek" <nedbrek(a)yahoo.com>
wrote:


>"mycmd" is just an example. It is whatever you pass in as the second
>argument to Tcl_CreateObjCommand
>Tcl_CreateObjCommand(interp, "mycmd", myCallback, NULL, NULL);

Sorry, this was badly expressed. I meant Tcl_CreateObjCommand().
It should be in a library, but i seem not to have any libraries, nor
do i have the necessary tcl.h.
I am using Tcl-Coach 2.5, whis has a nice tutorial (in german, good
for me) and the capability to produce standalone executables. Just
what a beginner like me needs.

Best regards

Klaus

From: APN on
I haven't gone through the entire thread so forgive me if you have
already rejected ffidl for whatever reason. It is simple enough to
use. The example below is condensed from http://wiki.tcl.tk/4016 and
may need some tweaking -

load ffidl05.dll ;# load the ffidl package
set DLL AutoItDLL.dll ;# save instead of retypeing this name in for
each function
# This dll needs to be in the path or system directory (so it is found
by ffidl)

# Define the function you want to call
ffidl::callout AUTOIT_WinMinimizeAll {} int [ffidl::symbol $DLL
AUTOIT_WinMinimizeAll]

# Now call it
AUTOIT_WinMinimizeAll

http://wiki.tcl.tk/16697 also contains another more complete example
of calling an "arbitrary" DLL from Tcl

/Ashok