#893 Bug in DDE 1.0 package found

obsolete: 8.1

OriginalBugID: 2124 Bug
Version: 8.1
SubmitDate: '1999-05-24'
LastModified: '1999-07-01'
Severity: MED
Status: Released
Submitter: pat
ChangedBy: foster
OS: Windows 95
OSVersion: NA
Machine: NA
FixedDate: '1999-05-28'
FixedInVersion: 8.2b1
ClosedDate: '2000-10-25'

Name: Peter Hardie
email: peteros@home.com
Support: None
Severity: 3
OperatingSystem: Windows 95
Extensions: DDE 1.0
CustomShell: Other than my fixes to DDE 1.0 the code is the distribution version.
Synopsis: Bug in DDE 1.0 package found

I reported the bug previously in comp.lang.tcl as a followup to another
bug report of bizarre behaviour in the DDE V1.0 package. In the example
I posted, my script was attempting to talk to Mirc, but the first such
message always caused netscape to be executed instead. However, now that
I know the cause of the problem it is clear that my example script will
not necessarily produce the same behaviour on another system because the
bug depends upon some things in the machine that are external to TCL/Tk.
I have included a short code segment showing the fix (I do not have
access to diff - sorry).

The problem is that Tcl_DdeObjCmd in TclWinDde.c is using the
ddeInstance variable before it has been initialized by calling the
Initialize() function.
See the code below. My fix may not be the most effective way to solve
the problem but it definitely does work.

In the Tcl_DdeObjCmd function in TclWinDde.c add the two calls to Initialize() as shown below:

if (length == 0) {
serviceName = NULL;
if (index != DDE_SERVERNAME) {
// *******************
// This call to Initialize() is essential so that ddeInstance is defined the
// first time through this routine.
ddeService = DdeCreateStringHandle(ddeInstance,serviceName,CP_WINANSI);

if ((index != DDE_SERVERNAME) &&(index != DDE_EVAL)) {
topicName = Tcl_GetStringFromObj(objv[firstArg + 1], &length);
if (length == 0) {
topicName = NULL;
} else {
// ***************************
// Must also call Initialize here too.
ddeTopic = DdeCreateStringHandle(ddeInstance,topicName, CP_WINANSI);

There are several other bugs in the code, but this is by far the most
I have also added a "dde poke" command to my version of dde 1.0 and once
I have tidied it up and squashed the other bugs, I will submit it (using
diff once I find it).

A call to Initialize has been added at the beginning of the block.
05/28/1999 15:53 - stanton -


  • Brent B. Welch

    Brent B. Welch - 2000-10-26
    • priority: 5 --> 2
    • status: open --> closed-fixed
  • Don Porter

    Don Porter - 2001-04-17
    • labels: 104246 --> 28. dde Package

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks