MFC CreteProcess
-
hi, I am using the create process function to open an application. but i guess my usage is not right. could somebody tell me what is wrong. the function i ahve used is...........
CreateProcess("C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe",NULL,NULL,NULL,TRUE,DEBUG_PROCESS ,NULL,NULL,NULL,NULL)
Thanks:) U get wht u Give -
hi, I am using the create process function to open an application. but i guess my usage is not right. could somebody tell me what is wrong. the function i ahve used is...........
CreateProcess("C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe",NULL,NULL,NULL,TRUE,DEBUG_PROCESS ,NULL,NULL,NULL,NULL)
Thanks:) U get wht u GiveShouldnt this be something like....
CreateProcess("C:\\Program Files\\Microsoft Visual Studio\\Common\\MSDev98\\Bin\\msdev.exe",NULL,NULL,NULL,TRUE,DEBUG_PROCESS ,NULL,NULL,NULL,NULL)
Hope this helps. - tareq
-
Shouldnt this be something like....
CreateProcess("C:\\Program Files\\Microsoft Visual Studio\\Common\\MSDev98\\Bin\\msdev.exe",NULL,NULL,NULL,TRUE,DEBUG_PROCESS ,NULL,NULL,NULL,NULL)
Hope this helps. - tareq
-
hi, I am using the create process function to open an application. but i guess my usage is not right. could somebody tell me what is wrong. the function i ahve used is...........
CreateProcess("C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe",NULL,NULL,NULL,TRUE,DEBUG_PROCESS ,NULL,NULL,NULL,NULL)
Thanks:) U get wht u Givecharu123 wrote: CreateProcess("C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe",NULL,NULL,NULL,TRUE,DEBUG_PROCESS,NULL,NULL,NULL,NULL) Do u want to attach
DEBUGGER
with the launched Process, if yes you also have to useWaitForDebugEvent
function with it. if NO, here is small piece of code:-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). "c:\\\\windows\\\\notepad.exe", // 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. ) { MessageBox( "CreateProcess failed." ); }
Don't ask me from where i get this code :->
[Vote One Here, Complete my Survey....] Alok Gupta
visit me at http://www.thisisalok.tk "I Think Believe this Will Help" -
You need to mention the two parameters(STARTUPINFO & PROCESS_INFORMATION) and initialize it. Then the path of the the ".exe" file should be specified with "\\" instead of "\". If u use "\" the compiler will understand that as a escape sequence. STARTUPINFO sinfo; PROCESS_INFORMATION pinfo; ZeroMemory( &sinfo, sizeof(sinfo) ); sinfo.cb = sizeof(sinfo); ZeroMemory( &pinfo, sizeof(pinfo) ); BOOL b = CreateProcess("C:\\Program Files\\Microsoft Visual Studio\\Common\\MSDev98\\Bin\\msdev.exe",NULL,NULL,NULL,NULL,NULL,NULL,NULL,&sinfo,&pinfo); int error = GetLastError(); try this and let me know, if u have any problem.:cool: Zxczc