Advertisement

opening an EXE from a program

Started by February 01, 2005 08:32 PM
14 comments, last by unfinished 19 years, 9 months ago
How about a .bat file
<Not-Entirely-On-Topic>
*cough* std::string *cough*
</Not-Entirely-On-Topic>

Enigma
Advertisement
I am trying to do something similar.

Its a small application(call it APP1) which shows some information (that bits done)
When the user clicks on the OK button I want (APP1) to close and start another application (APP2). I have looked at CreateProcess but I am not sure about a few things.


When I do the CreateProcess do i then have to wait for (APP2) to close before doing CloseHandle (pi.hProcess) & CloseHandle (pi.hThread) then close (APP1) or can i just release them.

I am Writing this C++Builder V6. (is there anyway of building the Application with all the neccessary dll or vcl files built into the exe)



I think ernow's suggestion to use IPC is pretty slick. There's other ways to handle that too but memory-mapped files are really cool.

jorgen
unfinished: just close the handles and let your app1 terminate. (Just terminating will also remove the handles but it's not the proper way)

This will NOT kill app2 but will allow app2 to terminate when it is ready. Processes will stay in memory as long as there are handles to them; so close those handles!


In Win32 there are no such things as child processes. Processes are completely independent.

Cheers
thanks ernow

and sorry for hijacking this thread.

This topic is closed to new replies.

Advertisement