鉴于主程序的标准定义:
int main(int argc, char *argv[]) {
...
}
Run Code Online (Sandbox Code Playgroud)
argcPOSIX系统在哪些情况下可以为零?
我正在使用CreateProcess这种方式:
resultCreate = CreateProcess(Command, CommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
//"Command" contains the executable file to execute
//"CommandLine" contains the parameters to pass to that executable
Run Code Online (Sandbox Code Playgroud)
参数如下:
Param1: "C:\Users\myuser\Desktop\file.dll"
Param2: "file" (module name)
Param3: " " (blank)
Run Code Online (Sandbox Code Playgroud)
所以完整的命令行字符串将是:
"C:\Users\myuser\Desktop\file.dll" file " "
Run Code Online (Sandbox Code Playgroud)
CreateProcess 成功运行可执行文件并应用前两个参数,但是当到达第三个时,它会抛出错误
The specified process could not be found.
Function " " could not be called, due to " " doesn't exist in the DLL "(null)"
Run Code Online (Sandbox Code Playgroud)
如何正确传递所需的参数?