execution!
-
Are you wanting to do so from within the IDE?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
From a command prompt (not DOS), type the name of your program followed by any command-line parameters that it supports.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
From a command prompt (not DOS), type the name of your program followed by any command-line parameters that it supports.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Which means you aren't doing anything with them. Look at:
GetCommandLine()
__argc/__argv
CWinApp::m_lpCmdLine (MFC)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Which means you aren't doing anything with them. Look at:
GetCommandLine()
__argc/__argv
CWinApp::m_lpCmdLine (MFC)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
I've been having network problems! Anyway i'm able to run it from Debug folder like F:\Debug>filename file1 file2 can you run this code from the command line
#include #include void main( VOID ) { STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); return; } // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); }
-
I've been having network problems! Anyway i'm able to run it from Debug folder like F:\Debug>filename file1 file2 can you run this code from the command line
#include #include void main( VOID ) { STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); return; } // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); }
mpapeo wrote: can you run this code from the command line Yes, why?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
mpapeo wrote: can you run this code from the command line Yes, why?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Well im having problems with the below code in the bold and italic line, because i don't want to hardcode the process which i want to create (mychildprocess). I want it to be one of the commandline arguments. [code] // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) [/code] So what can i replace TEXT with? oam
-
Well im having problems with the below code in the bold and italic line, because i don't want to hardcode the process which i want to create (mychildprocess). I want it to be one of the commandline arguments. [code] // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) [/code] So what can i replace TEXT with? oam
mpapeo wrote: Well im having problems... Meaning what? mpapeo wrote: if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // Command line. Per MSDN: The lpApplicationName parameter can be NULL. In that case, the module name must be the first white space-delimited token in the lpCommandLine string. You've not specified a valid module name for the
lpCommandLine
parameter.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
mpapeo wrote: Well im having problems... Meaning what? mpapeo wrote: if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // Command line. Per MSDN: The lpApplicationName parameter can be NULL. In that case, the module name must be the first white space-delimited token in the lpCommandLine string. You've not specified a valid module name for the
lpCommandLine
parameter.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
I dont understand that, if i specify the MyChildProcess as the commandline argument it execute correctly, but then if another process which has not been specified there it doesn't execute it but instead it still execute the hardcoded one. And what should i specify for the lpCommandLine parameter? oam
-
I dont understand that, if i specify the MyChildProcess as the commandline argument it execute correctly, but then if another process which has not been specified there it doesn't execute it but instead it still execute the hardcoded one. And what should i specify for the lpCommandLine parameter? oam