编译器错误 2039
我对从哪里得到这个编译器错误感到非常困惑。如果有人可以提供帮助,我将非常感激。这是错误(我有 16 个这样的错误):
Error 6 error C2039: 'ToInt16' : is not a member of 'System::String' c:\users\****.****\documents\visual studio 2005\projects\cpas1\cpas1\Form1.h 1265
这是受影响的一行代码:
part1Quantity = this->txtPartQuantity1->Text->ToInt16(0);
I am getting quite confused as to where I am getting this compiler error from. If anyone could help I would be very grateful. Here is the the error (I have 16 cases of it):
Error 6 error C2039: 'ToInt16' : is not a member of 'System::String' c:\users\****.****\documents\visual studio 2005\projects\cpas1\cpas1\Form1.h 1265
and here is the a line of code affected:
part1Quantity = this->txtPartQuantity1->Text->ToInt16(0);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找
Convert.ToInt16
(以 C++ 为例)。You're looking for
Convert.ToInt16
(with C++ example)..NET 字符串没有 ToInt16 方法。
如果您在 c# 中执行类似的操作并使用 string.ToInt16,那么它很可能是作为扩展方法实现的。
扩展方法不能作为对象成员函数从托管 C++ 中调用
.NET string doesn't have a ToInt16 method.
If you are doing something similar in c# and using string.ToInt16, chances are it is implemented as an extension method.
extension methods cannot be called as object member functions from managed C++