|
You last visited: Today at 21:18
Advertisement
[C++]CreateProcess()
Discussion on [C++]CreateProcess() within the CO2 Private Server forum part of the Conquer Online 2 category.
01/16/2012, 12:26
|
#16
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Quote:
Originally Posted by Korvacs
Yes you need a space, but that's not in order to put the argument at the second position, that's just to separate the Arguments from the executable path. All applications require this.
|
In other words, what I want to say is:
Code:
void main(){
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si);
char * procName = "D:\\Conquer Online 2.0\\Conquer.exe";
[SIZE="4"][B]char * procArg = " blacknull";[/B][/SIZE]
if(CreateProcess(procName,procArg,0,0,0,CREATE_DEFAULT_ERROR_MODE,0,"D:\\Conquer Online 2.0",&si,&pi))
return 0;
printf("CreateProcess failed (%d).\n", GetLastError() );
system("Pause");
}
should work.
|
|
|
01/16/2012, 13:30
|
#17
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by -impulse-
In other words, what I want to say is:
Code:
void main(){
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si);
char * procName = "D:\\Conquer Online 2.0\\Conquer.exe";
[SIZE="4"][B]char * procArg = " blacknull";[/B][/SIZE]
if(CreateProcess(procName,procArg,0,0,0,CREATE_DEFAULT_ERROR_MODE,0,"D:\\Conquer Online 2.0",&si,&pi))
return 0;
printf("CreateProcess failed (%d).\n", GetLastError() );
system("Pause");
}
should work.
|
yeah you are right the space working thanks
|
|
|
Similar Threads
|
CreateProcess Problem
12/16/2009 - General Coding - 17 Replies
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
TCHAR buf;
GetCurrentDirectory(MAX_PATH,buf);
TCHAR path = L"\"";
|
All times are GMT +2. The time now is 21:18.
|
|