gpt4 book ai didi

visual-studio - 如何显示 Win32 MessageBox?

转载 作者:行者123 更新时间:2023-12-05 08:19:24 25 4
gpt4 key购买 nike

我正在尝试制作一个弹出消息框,上面写着“Hello World”。我从文件>新建项目>Visual C++>CLR>Windows 窗体应用程序开始然后我从工具箱中拖出一个按钮到窗体上,双击它进入

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
MessageBox("Hello World");
}

然后我编译...但是我收到一条错误消息说

错误 C2440:“”:无法从“const char [12]”转换为“System::Windows::Forms::MessageBox”

最佳答案

你需要:

MessageBox::Show("Hello World");

(根据您在 Visual Studio 2005 中的说明进行测试。)

关于visual-studio - 如何显示 Win32 MessageBox?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1148538/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com