Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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]);

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
Posted
Updated 26-Mar-10 5:59am
v2

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900