Click here to Skip to main content
16,004,924 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: read stderr from console in Win32 Application Pin
led mike25-Oct-07 5:27
led mike25-Oct-07 5:27 
GeneralRe: read stderr from console in Win32 Application Pin
Roger Broomfield25-Oct-07 6:39
Roger Broomfield25-Oct-07 6:39 
GeneralRe: read stderr from console in Win32 Application Pin
sukem25-Oct-07 7:09
sukem25-Oct-07 7:09 
GeneralRe: read stderr from console in Win32 Application Pin
led mike25-Oct-07 7:35
led mike25-Oct-07 7:35 
AnswerRe: read stderr from console in Win32 Application Pin
David Crow25-Oct-07 8:46
David Crow25-Oct-07 8:46 
AnswerRe: read stderr from console in Win32 Application Pin
Randor 25-Oct-07 11:45
professional Randor 25-Oct-07 11:45 
AnswerRe: read stderr from console in Win32 Application Pin
sukem25-Oct-07 17:15
sukem25-Oct-07 17:15 
GeneralRe: read stderr from console in Win32 Application Pin
sukem25-Oct-07 22:45
sukem25-Oct-07 22:45 
created project Win32 Application and use this is function that help me to archive my goal

[code]

DWORD RunSilent(char* strFunct, char* strstrParams)
{
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
char Args[4096];
char *pEnvCMD = NULL;
char *pDefaultCMD = "CMD.EXE";
ULONG rc;

memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;

Args[0] = 0;

pEnvCMD = getenv("COMSPEC");

if(pEnvCMD){

strcpy(Args, pEnvCMD);
}
else{
strcpy(Args, pDefaultCMD);
}

// "/c" option - Do the command then terminate the command window
strcat(Args, " /c ");
//the application you would like to run from the command window
strcat(Args, strFunct);
strcat(Args, " ");
//the parameters passed to the application being run from the command window.
strcat(Args, strstrParams);

if (!CreateProcess( NULL, Args, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&StartupInfo,
&ProcessInfo))
{


return GetLastError();
}

WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
if(!GetExitCodeProcess(ProcessInfo.hProcess, &rc))
rc = 0;

CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);

return rc;

}
[/code]
I run this function with argument:
RunSilent("java -version","2>> javaVersion.txt");

many thanks you all helped me more
QuestionHow to send HTTP request with particular Agent name and get the response. Pin
Y K Kishore Kumar25-Oct-07 4:29
Y K Kishore Kumar25-Oct-07 4:29 
AnswerRe: How to send HTTP request with particular Agent name and get the response. Pin
led mike25-Oct-07 5:07
led mike25-Oct-07 5:07 
QuestionReport Generation in VC++ Pin
Shivarudrayya H25-Oct-07 3:35
Shivarudrayya H25-Oct-07 3:35 
AnswerRe: Report Generation in VC++ Pin
led mike25-Oct-07 4:13
led mike25-Oct-07 4:13 
QuestionDrawing WMF/EMF antialiased Pin
Alexandre GRANVAUD25-Oct-07 3:00
Alexandre GRANVAUD25-Oct-07 3:00 
Questionhi i want to color the cell of list control Pin
rajneshmalik25-Oct-07 2:30
rajneshmalik25-Oct-07 2:30 
AnswerRe: hi i want to color the cell of list control [modified] Pin
Force Code25-Oct-07 4:04
Force Code25-Oct-07 4:04 
AnswerRe: hi i want to color the cell of list control Pin
Roger Broomfield25-Oct-07 6:34
Roger Broomfield25-Oct-07 6:34 
GeneralRe: hi i want to color the cell of list control Pin
rajneshmalik29-Oct-07 23:31
rajneshmalik29-Oct-07 23:31 
GeneralRe: hi i want to color the cell of list control Pin
Roger Broomfield30-Oct-07 4:25
Roger Broomfield30-Oct-07 4:25 
AnswerRe: hi i want to color the cell of list control Pin
Nelek29-Oct-07 4:13
protectorNelek29-Oct-07 4:13 
GeneralRe: hi i want to color the cell of list control Pin
rajneshmalik29-Oct-07 23:28
rajneshmalik29-Oct-07 23:28 
QuestionAny good resource for learning windows drivers Pin
followait25-Oct-07 1:19
followait25-Oct-07 1:19 
AnswerRe: Any good resource for learning windows drivers Pin
JudyL_MD25-Oct-07 2:50
JudyL_MD25-Oct-07 2:50 
AnswerRe: Any good resource for learning windows drivers Pin
David Crow25-Oct-07 2:52
David Crow25-Oct-07 2:52 
Questionunusual problem Please help me Pin
Rahul Vaishnav25-Oct-07 0:57
Rahul Vaishnav25-Oct-07 0:57 
AnswerRe: unusual problem Please help me Pin
ThatsAlok25-Oct-07 2:17
ThatsAlok25-Oct-07 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.