seth Posted March 15 Share Posted March 15 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! Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted March 16 Share Posted March 16 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.