troubleshooting Question

Delphi 7, DDE Client problem

Avatar of SarusSystems
SarusSystems asked on
Delphi
4 Comments1 Solution2295 ViewsLast Modified:
I have a Delphi7 DDE client that talks do a 16 bit DDE server application.
This ran beautifully until recently.  The 16 bit server is not mine so I have no

control over it.

When I try the openlink ( with the 16 bit server not running ( or modally  busy ),

the D7 client freezes and I get an "application not responding" type message  in  

the Windows task manager.
(a timer running  in the client application don't trigger ontimer events when this

happens)

If the 16 bit server IS running, everything works as expected.


Tried the code below but 16 bit server not seen with DDE.WaitStat (understandably)


procedure TForm1.mIRCDDE(Service, Topic, Cmd: string);
var
      DDE: TDDEClientConv;
begin
      try
            DDE := TDDEClientConv.Create(nil);
            DDE.ConnectMode := ddeManual;
            DDE.SetLink(Service, Topic);
            Timer1.Enabled := true;   // for freeze test to see if ontimer event

works
            If DDE.WaitStat then  // If DDE server available //won't work with 16

bit server
             begin
              DDE.OpenLink
              DDE.PokeData(Topic, PChar(Cmd));
            end;
      finally
            DDE.Free;
      end;
end;


I changed the code  to

            if DDE.OpenLink then
                  DDE.PokeData(Topic, PChar(Cmd));
      finally
            DDE.Free;
      end;


Basically the application freezes on the openlink and stays frozen until terminated

with a three fingered salute.  I tried wrapping the Openlink in a Try/except but it

stayed frozen. Eureka doesn't work either.

I need a timeout on the DDEOpenlink I guess. Any help greatly appreciated.
Thanks

ASKER CERTIFIED SOLUTION
Lukasz Zielinski
software developer
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros