Board index » delphi » DDE doesn't work when client is a CGI program

DDE doesn't work when client is a CGI program

In order to keep track of system usage, I've built a system monitor
for an Internet application.
Each time the CGI program is launched by the Webserver (HTTPD 1.1), it
establishes a DDE connection with the sytem monitor. The system
monitor then increases the hitcount and beeps.
That is the way it _should_ work.
Unfortunately, the DDE connection fails to initialize.
When I run the CGI script directly (i.e. starting it manually from the
File Manager), the DDE connection is fine. The monitor beeps and
displays the hitcount.

The server uses the TDDEServerConv and TDDEServer, configured as
follows:

object dde_server: TDdeServerConv

object dde_item: TDdeServerItem
    ServerConv = dde_server
    Text = 'default'
    Lines.Strings = (
      'default')
    OnChange = dde_itemChange

procedure Tfrm_sysmon.dde_itemChange(Sender: TObject);
begin
    { a message has been received }
     if dde_item.Text=MESSAGE then
        begin
                inc(hitcount);
                Beep;
                end;

The CGI app is a console application, so I created the objects
manually:

     ddeconv:=TDdeClientConv.Create(nil);
     ddeconv.ConnectMode:=ddeManual;
     ddeconv.SetLink('','dde_server');  
     if ddeconv.OpenLink
        then Beep; { connection ok }
     ddeconv.PokeData('dde_item',MESSAGE);
     ddeconv.CloseLink;
     ddeconv.Free;

If anyone has any answers, or a clue to what might be wrong, i'd
really appreciate it.

Bas Pluim.

 

Re:DDE doesn't work when client is a CGI program


Hi
        Sorry, haven't got a solution to your prob, just wanna point out
that I'm having similar probs with EMWAC HTTPS. The script I'm having
probs with is a VB prog. The prog itself is triggered off by a perl
script, which is the actual CGI script. Anyway, the VB prog tries to do a
DDE link with another VB prog which is running the background, and it
works, just as in your case, if I invoke it without the HTTPS playing any
part, but once the whole chain is started by HTTPS, it fails, saying
there is no foreigh application responding to the DDE initiate.
        Anyone, pls help?!

-------------------------------------
Sng Swee Keat
email    : sj7311...@ntuvax.ntu.ac.sg

Other Threads