编译器错误 2039

发布于 2024-12-12 13:29:29 字数 362 浏览 1 评论 0原文

我对从哪里得到这个编译器错误感到非常困惑。如果有人可以提供帮助,我将非常感激。这是错误(我有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

简单爱 2024-12-19 13:29:29

您正在寻找 Convert.ToInt16 (以 C++ 为例)。

You're looking for Convert.ToInt16 (with C++ example).

满身野味 2024-12-19 13:29:29

.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++

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文