我正在尝试使用std :: string创建CreateProcess,我几乎搜索了所有地方以找出如何将std :: string转换为LPSTR
我是C ++的新手
我正在制作GUI,当我点击按钮时,我想根据我输入的路径和我放置的32位或64位复选框启动程序。
对于客户端目录,我将System :: String ^更改为std :: string
std::string path = this->getClientDirectory(); // Get the directory that the user has set
// Get the EXE bit that the user has ticked.
std::string exe;
if (this->isClient32Ticked)
exe = "client_x32.exe";
else
exe = "client_x64.exe";
//add the exe name to the end of the string.
path.append("\\");
path.append(exe);
CreateProcess(NULL, path, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);