#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    9
    Rep Power
    0

    combining strings to one.


    Hi, i cant figure out how to combine strings to 1, for example this is what i have, it works but buggy.

    bfvf : string = '\bfvietnam.exe +restart 1'; // Executable
    bfvc : string = ''//Command Line Options // doesnt work!
    bfvd : string = 'C:\Program Files\EA GAMES\Battlefield Vietnam'; //Directory

    Then to execute:


    CreateProcess(nil, PChar(bfvd+bfvf+bfvc), nil, nil,False,
    CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS,
    nil, nil, StartInfo, ProcInfo);
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,641
    Rep Power
    4247
    It's not the string concatenation that is not working, but rather how you're calling CreateProcess. Consult your help docs for CreateProcess or read the documentation here:
    http://msdn.microsoft.com/library/de...ateprocess.asp

    You need to enclose path names in double quotes, so that it doesn't mistake them for separate arguments (e.g.)
    bfvd : string = '"C:\Program Files\EA GAMES\Battlefield Vietnam"'; //Directory
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo