MessageBox的问题 [英] Problem with MessageBox

查看:67
本文介绍了MessageBox的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用

MessageBox("text","text");





这个在对话框项目中编译好但不在单个文档项目中 - 状态不需要2个参数。



AfxMessageBox()有效,但我想要在标题框中插入标题似乎不允许我。



不确定要使用什么?



请帮助



this compiles ok in a dialog project but not in a single document project- states does not take 2 params.

AfxMessageBox() works but I want to insert the title in the box and does not seem to let me.

Not sure what to use ?

please help

推荐答案

C ++ 程序中使用 MFC 您可以使用 Windows API 函数 MessageBox [ ^ ]或 MFC 方法 CWnd :: MessageBox [ ^ ]。

前者需要四个参数,后者可能需要三个,两个或只有一个参数(因为它有两个可选参数)。

在对话框应用程序中,您可能正在使用对话框的方法( CDialog 继承自 CWnd )在您的 SDI 应用程序中,您正在使用 Windows API 函数(您从全局范围调用它) ,这不是 CWnd - 派生的对象方法。)
In a C++ program using MFC you may use either the Windows API function MessageBox[^] or the MFC method CWnd::MessageBox[^].
The former takes four parameters, the latter may take three, two or just one parameter (because it has two optional parameters).
In your dialog application you are probably using the dialog''s method (CDialog inherits from CWnd) while in your SDI application you are using the Windows API function (you are calling it from global scope, that is not in a CWnd-derived object method).


这篇关于MessageBox的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆