Roshan
2008-06-17 23:04:41 UTC
To Any Whom Can Answer,
Hello. I was successfully executing the command "mode com6 baud=19200
parity=n data=8'
using the system() function. What I wanted though was for the console
window to not show up
every time ran the function. So after reading posts on the net, I
tried using CreateProcess() which gave the option of hiding the
window. The Problem now is CreateProcess() is not running the command
at all. Not sure why. I have placed a snippet of my code. Please let
me know why CreateProcess can't execute the "mode" command in DOS.
...
STARTUPINFO si;
PROCESS_INFORMATION pi;
CString tempString = "mode com6 baud=19200 parity=n data=8";
char* cmdLine = tempString.GetBuffer(tempString.GetLength());
CreateProcess(NULL, cmdLine, NULL, NULL, false, 0, NULL, NULL, &si,
&pi);
tempString.ReleaseBuffer();
...
Hello. I was successfully executing the command "mode com6 baud=19200
parity=n data=8'
using the system() function. What I wanted though was for the console
window to not show up
every time ran the function. So after reading posts on the net, I
tried using CreateProcess() which gave the option of hiding the
window. The Problem now is CreateProcess() is not running the command
at all. Not sure why. I have placed a snippet of my code. Please let
me know why CreateProcess can't execute the "mode" command in DOS.
...
STARTUPINFO si;
PROCESS_INFORMATION pi;
CString tempString = "mode com6 baud=19200 parity=n data=8";
char* cmdLine = tempString.GetBuffer(tempString.GetLength());
CreateProcess(NULL, cmdLine, NULL, NULL, false, 0, NULL, NULL, &si,
&pi);
tempString.ReleaseBuffer();
...