Register for your free account! | Forgot your password?

You last visited: Today at 15:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++]CreateProcess()

Discussion on [C++]CreateProcess() within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old 01/16/2012, 12:26   #16
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by Korvacs View Post
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.
-impulse- is offline  
Thanks
2 Users
Old 01/16/2012, 13:30   #17
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by -impulse- View Post
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
Mr_PoP is offline  
Reply


Similar Threads 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 +1. The time now is 15:51.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.