no instance of overloaded function "AfxMessageBox" matches the argument list
2013-03-25 23:09
1046 查看
问题描述
解决方案
添加 L 如下
AfxMessageBox( L"Failed to connect to server\nTry again?",MB_YESNO)
究其原因是“字符集”的问题,改“使用 Unicode 字符集”为 “使用多字节字符集” AfxMessageBox("Failed to connect to server\nTry again?",MB_YESNO) 不添加 L 也 可以。
nType The style of the message box. Apply any of the
message-box styles to the box. nIDHelp The Help context ID for the message; 0 indicates the application's default Help context will be used.
lpszText in the message box and uses nIDHelp to describe a Help context. The Help context is used to jump to an associated Help topic when the user presses the Help key (typically F1).
AfxMessageBox("Failed to connect to server\nTry again?",MB_YESNO) 出现问题:no instance of overloaded function "AfxMessageBox" matches the argument list
解决方案
添加 L 如下
AfxMessageBox( L"Failed to connect to server\nTry again?",MB_YESNO)
究其原因是“字符集”的问题,改“使用 Unicode 字符集”为 “使用多字节字符集” AfxMessageBox("Failed to connect to server\nTry again?",MB_YESNO) 不添加 L 也 可以。
int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );
Parameters
lpszText Points to a CString object or null-terminated string containing the message to be displayed in the message box.nType The style of the message box. Apply any of the
message-box styles to the box. nIDHelp The Help context ID for the message; 0 indicates the application's default Help context will be used.
Remarks
The first form of this overloaded function displays a text string pointed to bylpszText in the message box and uses nIDHelp to describe a Help context. The Help context is used to jump to an associated Help topic when the user presses the Help key (typically F1).
Example
// A simple message box, with only the OK button. AfxMessageBox("Simple message box."); // A message box that uses a string from a string table // with yes and no buttons and the stop icon. // NOTE: nStringID is an integer that contains a valid id of // a string in the current resource. AfxMessageBox(nStringID, MB_YESNO|MB_ICONSTOP);
参考:AfxMessageBox 在vs2008中的问题
相关文章推荐
- no instance of overloaded function "std::tr1::bind" matches the argument list
- 解决error C2664: no instance of constructor "CFileDialog::CFileDialog" matches the list
- Given constant integers x and t, write a function that takes no argument and returns true if the function has been called x number of times in last t secs.
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No resource found that matches the given name (at 'layout_constraintRight_toLeftOf' w
- Error:(26, 34) No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/b
- 怎样解决错误:error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance:
- add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
- 有关Eclipse创建android工程报错:No resource found that matches the given name"Theme.AppCompat.Light"
- Java编译错误“No enclosing instance of type AA is accessible. Must qualify the allocation with an enclosing instance of type SimpleTh
- The target assembly contains no service types. You may need to adjust the Code Access Security policy of this assembly." 目标程序集不包含服务类型。可能需要调整此程序集的代码访问安全策略。
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No resource found that matches the given name 'Widget.AppCompat.Base.ListPopupWindow'
- Java编译错误“No enclosing instance of type AA is accessible. Must qualify the allocation with an enclosing instance of type SimpleTh
- [Java]Error:No enclosing instance of type E is accessible. Must qualify the allocation with an enclo
- No enclosing instance of type Multh is accessible. Must qualify the allocati
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing