Shell Execute Timing


Recommended Posts

Hi All,

 

It seems the shell execute function does not hold up DAQFactory, but if I am trying to get a response from a process or wait until a process is complete is there a way to run shell execute with a return from standard out? Right now I'm just thinking of a hacky way of having the other process write a text file that DAQFactory waits until it exists, but that doesn't seem very elegant.

 

Thanks!

Link to comment
Share on other sites

ShellExecute() creates a completely separate process, and there really aren't easy ways in Windows for processes to communicate with each other.  Windows does this for good reasons.  If you are writing your own code, it is usually best to create a DLL that DAQFactory can link to using extern() instead of an Exe it has to run.  A DLL runs in the DAQFactory process, so DAQFactory will wait for a response.  With ShellExecute() it is completely fire and forget.  Really your only alternative is to use a file or some other normal interprocess communication technique such as sockets, so while it seems it isn't very elegant, it is unfortunately the only choice.  (actually you could also search for the other processes window, but that gets into the real nitty gritty of Windows).   This limitation would be true basically with any application, not just DAQFactory.  It is why there are DLLs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.