Link to home
Start Free TrialLog in
Avatar of andyshab
andyshab

asked on

Calling Scripts from C++

How do I call a script (.bat, .PHP) asynchronously from C++.  Using system or CreateProcess causes my program to hang until the script is complete.  Thanks
Avatar of -null-
-null-

Hi,

There are a number of ways you could achieve this, the most logical is to run the system call in a new thread.

Multithreaded programming is outside of the scope of this little box, but a quick google will bring up some really good examples

-null-
Avatar of andyshab

ASKER

A thread makes sense but seems like overkill.  I am currently called CreateProcess and not waiting for the process, just closing the hProcess and hThread handle right away.  This seems to work as long as I'm not leaking any resources.
ASKER CERTIFIED SOLUTION
Avatar of tampnic
tampnic
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial