⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_36598.htm

📁 vc
💻 HTM
字号:
<p>
序号:36598 发表者:dayong 发表日期:2003-04-17 00:24:10
<br>主题:MessageBox用的时候有什么讲究吗?
<br>内容:我在按钮的处理函数里调用很正常,在自定义的一个类的成员函数里调要就出错:function does not take 3 parameters
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:neilgan 回复日期:2003-04-17 00:28:27
<br>内容:In the classes derived from CWnd, You actually call a member function when you call MessageBox.<BR>pCWnd-&gt;MessageBox(Arg01,Arg02,Arg03) is actually ::MessageBox(pCWnd-&gt;m_pWnd,Arg01,Arg02,Arg03)<BR><BR>you should use MessageBox(NULL,Message,Title,Flags) in your own class.<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:理文 回复日期:2003-04-18 10:04:04
<br>内容:在view类的类里可用MessageBox,在别的地方你可用AfxMessageBox。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:罗兹维尔 回复日期:2003-04-18 10:46:54
<br>内容:CWnd::MessageBox<BR>Creates and displays a window that contains an application-supplied message and caption, plus a combination of the predefined icons and pushbuttons described in the Message-Box Styles list.<BR><BR>int MessageBox(<BR>&nbsp;&nbsp; LPCTSTR lpszText,<BR>&nbsp;&nbsp; LPCTSTR lpszCaption = NULL,<BR>&nbsp;&nbsp; UINT nType = MB_OK <BR>);<BR>Parameters<BR>lpszText <BR>Points to a CString object or null-terminated string containing the message to be displayed. <BR>lpszCaption <BR>Points to a CString object or null-terminated string to be used for the message-box caption. If lpszCaption is NULL, the default caption "Error" is used. <BR>nType <BR>Specifies the contents and behavior of the message box. <BR>Return Value<BR>Specifies the outcome of the function. It is 0 if there is not enough memory to create the message box.<BR><BR>Remarks<BR>Use the global function AfxMessageBox instead of this member function to implement a message box in your application.<BR><BR>可见MessageBox是CWnd的成员函数,而CView是继承于CWnd的,所以可以直接用,而在其他类里就不行了,要用全局函数AfxMessageBox
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -