Subj : Re: CreateProcess To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Thu Jun 17 2004 06:55 pm > i get an error from the CreateProcess () and the error code > is 1813. i don't understand why. Error number 1813 decimal translates to the specified resource type cannot be found in the image file. It might be useful to compile this code and link it into programs you write. When there is an error you can call it to get the error message in text. It works in both console and gui apps, although for both it does use a message box. --------------------------- #include void ShowLastError(const char *title_text = NULL) { TCHAR *err_msg; const char *title = (title_text && *title_text) ? title_text : "Error"; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&err_msg), 0, NULL); MessageBox(HWND_DESKTOP, err_msg, title, MB_OK); LocalFree(err_msg); SetLastError(0); } --------------------------- Of course that error message leaves it up to you to figure out what kind of resource type it is complaining about. > > If you absolutely must shut it down, send a WM_CLOSE ... > > this makes sense, but the problem is that the application i > launch is not a GUI application and doesn't process the > WM_CLOSE ... Try remapping stdin to an unnamed pipe or memory mapped file or something like that so that you can from your program provide the key combinations telling it to shut down. The STARTUPINFO structure used in the call to CreateFile has provisions for setting the handles the program will use for stdin, stdout and stderr. .. Ed > mike wrote in message > news:40d20d48@newsgroups.borland.com... > > 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 ... > > 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. .