私がのstd ::文字列でのCreateProcessにしようとしていますが、私はC++のCreateProcess ::文字列
に新しいですをLPSTRするのstd ::文字列を変換する方法を見つけ出すことはほとんどどこでも検索しました
私はGUIを作っています。ボタンをクリックすると、私が入力したパスと32ビットまたは64ビットのチェックボックスに基づいてプログラムを起動します。
私はシステムを変更するクライアントディレクトリの::文字列^はstdする::文字列
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);
パスを試してください: –
[std :: string]から 'LPSTR'に変換できません(https://stackoverflow.com/questions/3906515/cannot-convert-from-stdstring-to) -lpstr) – TheKitchenSink
ありがとう@TheKitchenSink – StokesMagee