admin管理员组文章数量:1125346
I'm doing a imple MFC on VS2022.
What it does is choosing a file ,a comport and then system call my executable(input myfile).
like this
private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) {
String^ Comport;
String^ FWPath;
String^ Cmd;
Comport = cbPort->Text;
FWPath = openFileDlg->FileName;
Cmd = ".\mytest.exe " + path + " " + geoComport->Substring(3);
msclr::interop::marshal_context ctx;
const char* converted = ctx.marshal_as <const char*>(Cmd);
MessageBox::Show(Cmd->ToString());
std::system(converted);}
I get my file path and comport already.
And I can see that the thole Cmd on messagebox, and certain that it is right.
But the last line system(converted) does work imagined.
A window pop up and desappear very quickly.
Is that what i wrong doing with the function system()?
本文标签: windowsMFC system call not work using C command system()Stack Overflow
版权声明:本文标题:windows - MFC system call not work using C++ command system() - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736656985a1946280.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论