Solved

DDE SetLink Snafu

Posted on 1997-05-28
2
359 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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