次の関数があります。これは、フォルダーが存在するかどうかを教えてくれることを願っていますが、呼び出すと、このエラーが発生します-
パラメータ 1 を 'System::String ^' から 'std::string' に変換できません
関数 -
#include <sys/stat.h>
#include <string>
bool directory_exists(std::string path){
struct stat fileinfo;
return !stat(path.c_str(), &fileinfo);
}
呼び出し (ユーザーがフォルダーを選択するフォームを保持する form.h ファイルから) -
private:
System::Void radioListFiles_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
if(directory_exists(txtActionFolder->Text)){
this->btnFinish->Enabled = true;
}
}
これを修正する方法を教えてくれる人はいますか?ありがとう。