【发布时间】:2012-09-25 08:03:41
【问题描述】:
我在 C++ Builder 中使用 VCL Forms 应用程序。 能否请我在一些代码中提供一些帮助,以显示带有 YesNoCancel 按钮的消息框,然后检测是否按下了是、否或取消按钮。
这是我的代码:
if(MessageBox(NULL, "Test message", "test title", MB_YESNOCANCEL) == IDYES)
{
}
我已包含以下内容:
#include <windows.h>
我收到以下错误:
E2034 无法将 'char const[13]' 转换为 'const wchar_t *'
E2342 参数“lpText”中的类型不匹配(需要“const wchar_t *”,得到“const char *”)
更新
这是我的代码:
const int result = MessageBox(NULL, L"You have " + integerNumberOfImportantAppointments + " important appointments. Do you wish to view them?", L"test title", MB_YESNOCANCEL);
值:integerNumberOfImportantAppointments 是一个整数。如何在消息框中显示它?
我收到以下错误:无效的指针添加。
另外,我可以选择消息框的图标吗?本例中的一个问题。
【问题讨论】:
标签: c++ messagebox vcl