Click to See Complete Forum and Search --> : How can I catch MS-Dos window message?


Xiaojian Liu
May 14th, 1999, 06:33 AM
Some exes like java.exe, javac.exe, display
output on the MS-Dos window. How can I
catch the message if I use

CreateProcess
ShellExecute
ShellExecuteEx

to execute them from a my appliucation created
by VC++?


Your advice would be highly appreciated.

Xiaojian Liu

laura_glow
December 23rd, 2003, 01:13 PM
I need the same thing. im executing mysqldump.exe and mysql.exe, how toknow if execution failed, error messages, results, etc? they are in a DOS window.

Thanks

Mick
December 23rd, 2003, 01:48 PM
Originally posted by laura_glow
I need the same thing. im executing mysqldump.exe and mysql.exe, how toknow if execution failed, error messages, results, etc? they are in a DOS window.

Thanks

your not explaning it clear...or maybe we are not hearing it clear...

laura_glow
December 23rd, 2003, 03:21 PM
well, for example, i could get the exit code from mysql.exe (executed with shellExecuteEx from my visual c++ application) with


BOOL GetExitCodeProcess(
HANDLE hProcess, // handle to the process
LPDWORD lpExitCode // address to receive termination status
);



the problem is i cant find the exit codes for that program, so is there any other way to know if the execution of mysql.exe and its parameter was successfull?


C:\backup>mysqldump sdlfkj
-- MySQL dump 8.22
--
-- Host: localhost Database: sdlfkj
---------------------------------------------------------
-- Server version 3.23.51-max-nt
mysqldump: Got error: 1044: Access denied for user: '@localhost' to database 'sdlfkj' when selecting the database



here is an error example from mysqldump, with this parameter (purposefully wrong) it sends error 1044, is there a list of this errors somewhere?

how can i know if something went wrong from my visual c++ application?

Mick
December 23rd, 2003, 04:44 PM
winerror.h... getlasterror(...) errorlook.exe(...) tell me when to stop

selvamselvam
December 23rd, 2003, 05:04 PM
Hi,

You can use ShellExecute(NULL,"open","full path with file name","full path with arguments", default directory,cmdshow)

With Regards,
R.Selvam