DLL应用程序中的编译器错误 [英] Compiler Error in a DLL application

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

问题描述


我是C ++/CLI的新手,我正在写的DLL应用程序中出现编译器错误....

DLL是从调用应用程序以文本字符串传递的,该字符串需要转换为无符号的整数....

Hi,
I''m new to C++/CLI and I am getting compiler errors in a DLL appliction I am writing....

The DLL is passed in a text string from the calling application which needs to be cast to an unsigned int....

unsigned int^ pointParam = reinterpret_cast<unsigned int^>(dictParameters[POINT_PARAM]);


然后我使用整数值创建一个双精度值数组
但是我需要将值增加2,所以我想可以将其添加到数组声明语句中...


Then I am using the integer value to create an array of double values
but I need to increase the value by 2 so I thought I could add it in the array declaration statement...

sagXArray = gcnew array<double>(pointParam + 2);



我收到以下编译错误...



I am getting the following compile error...

StrandedWireSag.cpp(42) : error C2676: binary ''+'' : 
''System::UInt32 ^'' does not define this operator or a conversion 
to a type acceptable to the predefined operator



为什么编译器不满意在声明中添加两个值?

感谢



Why is the compiler unhappy about adding two values in a declaration?

Thanks

推荐答案

UInt32 ^是一个int的句柄,而不是int的句柄.因此,您有两种不同的类型.我对C ++/CLI的了解还不足以知道如何进行转换,但是我希望您可以将2用作UInt ^,它将正常工作.
UInt32^ is a handle to an int, not an int. So you have two different types. I don''t know enough about C++/CLI to know how to convert it, but I expect if you can make your 2 a UInt^, it will work fine.


这篇关于DLL应用程序中的编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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