Solved

DDE SetLink Snafu

Posted on 1997-05-28
2
351 Views
Last Modified: 2010-04-03
I attempt to use SetLink (with a DDEClientConv) to determine
whether or not an application is running, then I take action
depending on the result. I have tried this with ConnectMode set to ddeManual and ddeAutomatic but I get the same odd effect - namely, the application I am searching for gets executed if it isn't already running! Now, this doesn't happen all the time - I can write a very simple Delphi program to turn a program on and off that works as expected - but in the context of a larger, more complicated Delphi program I see this behaviour happenning. My question to you is, what might make SetLink behave this way? (actually I think it's the OpenLink implicit to a ddeAutomatic that causes it to happen. When I do it with ddeManual it is not the SetLink but the OpenLink which causes an instance of the  
app to be fired up).  
0
Comment
Question by:sidarthur
2 Comments
 

Accepted Solution

by:
arnoldu earned 100 total points
ID: 1336637
I have looked up the thing in the VCL (assuming you are using Delphi 2.0). Whats going on is this:
OpenLink tries to establish a DDEConversation via a DDEConnect to the application ... if this DDEConnect fails then OpenLink executes a WinExec on the application, even if it is already running. Write me if you want me to go more inside the problem - I could send you some lines from the source code and comment it for you that you understand whats possibly wrong
//Arnold
0
 

Author Comment

by:sidarthur
ID: 1336638
Arnoldu:

So your saying that there is an explicit attempt by the OpenLink to open the application using WinExec? How is it getting the path
and name of the application to run?!? More importantly, how do I
avoid it doing that?

Thanks.

  - S -
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now