Paths and CreateProcess

前端 未结 4 1972
小蘑菇
小蘑菇 2021-01-15 16:46

I have a question regarding a symptom of my misuse of CreateProcess. I\'m using the lpcommandline parameter to feed the path to my executable and parameters. My misuse is t

4条回答
  •  鱼传尺愫
    2021-01-15 17:23

    You should read this page:
    http://msdn.microsoft.com/en-us/library/ms682425.aspx

    • If the application name is NULL (first parameter).
    • It uses the first space separated word in the command line (second parameter) as the application name.
    • If the application name contains a space it must be quoted.

    Again code is worth a million words:
    Does it look like this:

    char commandline[] = "C:\Program Files\My Company\doit.exe parameter1 parameter2";
    CreateProcess(NULL,commandline, .... );
    

    Or are you generating the path name somwhere?
    Remember generic questions will only get you generic answers.
    You have to be specific before you get a specific answer on why there is just too much speculation otherwise.

提交回复
热议问题