Click here to Skip to main content
14,879,779 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: read stderr from console in Win32 Application Pin
led mike25-Oct-07 5:27
Memberled mike25-Oct-07 5:27 
GeneralRe: read stderr from console in Win32 Application Pin
Roger Broomfield25-Oct-07 6:39
MemberRoger Broomfield25-Oct-07 6:39 
GeneralRe: read stderr from console in Win32 Application Pin
sukem25-Oct-07 7:09
Membersukem25-Oct-07 7:09 
GeneralRe: read stderr from console in Win32 Application Pin
led mike25-Oct-07 7:35
Memberled mike25-Oct-07 7:35 
AnswerRe: read stderr from console in Win32 Application Pin
David Crow25-Oct-07 8:46
MemberDavid 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
Membersukem25-Oct-07 17:15 
GeneralRe: read stderr from console in Win32 Application Pin
sukem25-Oct-07 22:45
Membersukem25-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
MemberY 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
Memberled mike25-Oct-07 5:07 
QuestionReport Generation in VC++ Pin
Shivarudrayya H25-Oct-07 3:35
MemberShivarudrayya H25-Oct-07 3:35 
AnswerRe: Report Generation in VC++ Pin
led mike25-Oct-07 4:13
Memberled mike25-Oct-07 4:13 
QuestionDrawing WMF/EMF antialiased Pin
Alexandre GRANVAUD25-Oct-07 3:00
MemberAlexandre GRANVAUD25-Oct-07 3:00 
Questionhi i want to color the cell of list control Pin
rajneshmalik25-Oct-07 2:30
Memberrajneshmalik25-Oct-07 2:30 
AnswerRe: hi i want to color the cell of list control [modified] Pin
Force Code25-Oct-07 4:04
MemberForce Code25-Oct-07 4:04 
AnswerRe: hi i want to color the cell of list control Pin
Roger Broomfield25-Oct-07 6:34
MemberRoger Broomfield25-Oct-07 6:34 
GeneralRe: hi i want to color the cell of list control Pin
rajneshmalik29-Oct-07 23:31
Memberrajneshmalik29-Oct-07 23:31 
GeneralRe: hi i want to color the cell of list control Pin
Roger Broomfield30-Oct-07 4:25
MemberRoger 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
Memberrajneshmalik29-Oct-07 23:28 
QuestionAny good resource for learning windows drivers Pin
followait25-Oct-07 1:19
Memberfollowait25-Oct-07 1:19 
AnswerRe: Any good resource for learning windows drivers Pin
JudyL_MD25-Oct-07 2:50
MemberJudyL_MD25-Oct-07 2:50 
AnswerRe: Any good resource for learning windows drivers Pin
David Crow25-Oct-07 2:52
MemberDavid Crow25-Oct-07 2:52 
Questionunusual problem Please help me Pin
Rahul Vaishnav25-Oct-07 0:57
MemberRahul Vaishnav25-Oct-07 0:57 
AnswerRe: unusual problem Please help me Pin
ThatsAlok25-Oct-07 2:17
MemberThatsAlok25-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.