Subj : Re: CreateProcess To : borland.public.cpp.borlandcpp From : mike Date : Thu Jun 17 2004 10:29 pm > If you want to shut it down prematurely you should start by asking > yourself why you need to do that and why you are launching that > program when you did not want it to do what it is supposed to do. i launch it to do some calculations and to update an XML file. it does all this ok and exits as expected. the problem is after about 7 times this happens i get an error from the CreateProcess () and the error code is 1813. i don't understand why. > If you absolutely must shut it down, send a WM_CLOSE message to each > of its top level windows. TerminateProcess is only for an emergency > shutdown of the program and does not clean up by unloading DLL's and > freeing all resources. Especially if using an OS from the Windows > 95/98/ME tree, failing to unload and free those items can have a bad > effect on the operating system. this makes sense, but the problem is that the application i launch is not a GUI application and doesn't process the WM_CLOSE message. it's a console app. i only terminate it when i close my GUI so this won't be too bad. aloha, mike .