用C ++编写的Visual Studio 2010中的MessageBox()错误 [英] MessageBox() error in Visual Studio 2010 written in C++

查看:297
本文介绍了用C ++编写的Visual Studio 2010中的MessageBox()错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,这是我的代码

Guys, this is my code

void Cday1Dlg::OnClickedIdhello()
{
    // TODO: Add your control notification handler code here
      MessageBox(
        NULL,
        (LPCWSTR)L"Resource not available\nDo you want to try again?",
        (LPCWSTR)L"Account Details",MB_OK);
}



我是Visual C ++的新手,我从官方微软获得了这个功能用法,仍然收到此错误,帮帮我!

错误:

错误3错误C2660:'CWnd :: MessageBoxW':函数不带4个参数c:\ usersrs \jeevan \documents\visual studio 2010 \ project \day1\day1\day1dlg.cpp 171 1天1


I am new to Visual C++, I got this function usage from official microsoft, still getting this error, help me out!
Error:
Error 3 error C2660: 'CWnd::MessageBoxW' : function does not take 4 arguments c:\users\jeevan\documents\visual studio 2010\projects\day1\day1\day1dlg.cpp 171 1 day1

推荐答案

每个 CWnd 都有 MessageBox [ ^ ]功能,其中消息框的父级是 CWnd 你是从中调用它。



如果你想调用全局函数,请确保指定全局范围



Each CWnd has a MessageBox[^] function where the parent of the message box is the CWnd you're calling it from.

If you want to call the global function, make sure you specify the global scope

::MessageBox(NULL, L"Message", L"Title", MB_OK)


这篇关于用C ++编写的Visual Studio 2010中的MessageBox()错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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