错误C2665: [英] error C2665:

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

问题描述

我认为我在转换中遇到错误,因此请从这里帮助我


char * x ="SHOW ME PLEASE";
MessageBox :: Show(* x,"Name Entry Error",MessageBoxButtons :: OK,MessageBoxIcon :: Exclamation);

它显示错误:
1> ------开始构建:项目:转换,配置:调试Win32 ------
1>正在编译...
1> convert.cpp
1> c:\ users \ inder \ documents \ Visual Studio 2008 \ projects \ convert \ convert \ Form1.h(104):错误C2665:``System :: Windows :: Forms :: MessageBox :: Show'':无21个重载中的一个可以转换所有参数类型
1> c:\ windows \ microsoft.net \ framework \ v2.0.50727 \ system.windows.forms.dll:可能是``System :: Windows :: Forms :: DialogResult System :: Windows :: Forms :: MessageBox: :Show(System :: String ^,System :: String ^,System :: Windows :: Forms :: MessageBoxButtons,System :: Windows :: Forms :: MessageBoxIcon)''
1> c:\ windows \ microsoft.net \ framework \ v2.0.50727 \ system.windows.forms.dll:或''System :: Windows :: Forms :: DialogResult System :: Windows :: Forms :: MessageBox :: Show(System :: Windows :: Forms :: IWin32Window ^,System :: String ^,System :: String ^,System :: Windows :: Forms :: MessageBoxButtons)''
1>尝试匹配参数列表''(char,const char [17],System :: Windows :: Forms :: MessageBoxButtons,System :: Windows :: Forms :: MessageBoxIcon)''
1>构建日志保存在文件://c:\ Users \ Inder \ Documents \ Visual Studio 2008 \ Projects \ convert \ convert \ Debug \ BuildLog.htm"
1>转换-1个错误,0个警告
========== Build:0成功,1失败,0最新,跳过0 ==========
实际的完全错误是这样,我正在等待响应...

在此先感谢,

I think i am facing an error in conversion, so please help me out from here


char *x="SHOW ME PLEASE";
MessageBox::Show( *x, "Name Entry Error", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );

It shows error :
1>------ Build started: Project: convert, Configuration: Debug Win32 ------
1>Compiling...
1>convert.cpp
1>c:\users\inder\documents\visual studio 2008\projects\convert\convert\Form1.h(104) : error C2665: ''System::Windows::Forms::MessageBox::Show'' : none of the 21 overloads could convert all the argument types
1> c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll: could be ''System::Windows::Forms::DialogResult System::Windows::Forms::MessageBox::Show(System::String ^,System::String ^,System::Windows::Forms::MessageBoxButtons,System::Windows::Forms::MessageBoxIcon)''
1> c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll: or ''System::Windows::Forms::DialogResult System::Windows::Forms::MessageBox::Show(System::Windows::Forms::IWin32Window ^,System::String ^,System::String ^,System::Windows::Forms::MessageBoxButtons)''
1> while trying to match the argument list ''(char, const char [17], System::Windows::Forms::MessageBoxButtons, System::Windows::Forms::MessageBoxIcon)''
1>Build log was saved at "file://c:\Users\Inder\Documents\Visual Studio 2008\Projects\convert\convert\Debug\BuildLog.htm"
1>convert - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Actual full error is this, i am waiting for response...

Thanks in advance,

推荐答案

尝试一下:
Try this:
MessageBox::Show( x, "Name Entry Error", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );


*x(char)''S'',是字符串的第一个字符


*x is (char)''S'', the first character of your string


尝试传递"x"而不是"* x":)
Try to pass "x" and not "*x" :)


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

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