相关疑难解决方法(0)

在POSIX系统上,argc可以为零吗?

鉴于主程序的标准定义:

int main(int argc, char *argv[]) {
   ...
}
Run Code Online (Sandbox Code Playgroud)

argcPOSIX系统在哪些情况下可以为零?

c posix program-entry-point language-lawyer

73
推荐指数
4
解决办法
4269
查看次数

C++ Winapi CreateProcess 问题与命令行

我正在使用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)

如何正确传递所需的参数?

c++ parameters null winapi createprocess

1
推荐指数
1
解决办法
2445
查看次数