For Programmers: Free Programming Magazines  


Home > Archive > Tcl > November 2006 > DDE package and the handler callback









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DDE package and the handler callback
MartinLemburg@UGS

2006-11-29, 4:09 am

Hello,

a question and a suggestion about the DDE handler callback ... but
first a kind of "what is, and what I expected".

When I register my tcl application as DDE server using ...

dde servername -handler ddeHandlerCB "MyTclApp"

.... than I expected the procedure or command ddeHanlderCB to be called
for all those DDE actions ...

- dde eval ...
- dde execute ...
- dde request ...
- dde poke ...

The documentation tells something inspecific about this handler like:

The -handler option specifies a Tcl procedure that will be called to
process calls to the dde server. If the package has been loaded into a
safe interpreter then a -handler procedure must be defined. The
procedure is called with all the arguments provided by the remote call.


So I expected the following DDE handler to work ...

proc ddeHandlerCB {args} {
puts "args count = [llength $args]";
puts "args = '$args'";

return [uplevel #0 $args];
}

It didn't work because the DDE handler only received one argument, a
string with the "dde eval" or "dde execute" command line.

It was only called for those two "events" ...

dde eval ...
dde execute ...

So my question or suggestion:

Could the man page please be updated to be more specific?

Or

Could this callback mechanism be extended to react an all DDE "events"
mentioned above? And could the DDE handler API be extended to have more
chances to influence or to control the DDE data exchange like the
following ...

proc ddeHandlerCB {server topic event args} {
puts "processing DDE event $event ...";
puts " initiated by \"$server\"";
puts " with the topic \"$topic\"";
puts "";
puts "data/script to be processed: '$args'";

# ...
}

My suggestion is not based on a fundamental knowledge about DDE and its
possiblities, but simply a wish to have more control about the DDE
actions raised by "foreign" software examining the interface I provide
via DDE.

Thanks for all input!

Martin Lemburg
UGS - Transforming the Process of Innovation

P.S.: Why does the "dde poke" not work with a tcl DDE server? But
perhabs I didn't understood the man page!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com