scanf("%s",this->txt_cfile_par->Text);
String^ temp = this->txt_cfile_par->Text;
void MarshalString ( String ^ s, string& os )
{
using namespace Runtime::InteropServices;
const char* chars =
(const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer();
os = chars;
Marshal::FreeHGlobal(IntPtr((void*)chars));
}
strncpy(cfile_par,temp.c_str(),c_str.length());
System::Windows::Forms::MessageBox::Show(temp);
error C2601: “MarshalString”: 本地函数定义是非法的
error C2228: “.c_str”的左边必须有类/结构/联合
error C2228: “.length”的左边必须有类/结构/联合
error C2679: 二进制“+”: 没有找到接受“char *”类型的右操作数的运算符(或没有可接受的转换)
冉冉说
相关分类