I use C ++ / CLI only for the unit test of unmanaged C ++ code in VS2010. I switched the compiler to / clr and used unmanaged code from a static library.
I have a simple intproperty in my test class. I would like to pass this as const int &functions in native C ++. But it cannot compile, and I found out about it because you cannot mix such links.
How to do this, I tried to follow and work, but is there a better way?
[TestClass]
public ref class MyTestClass
{
private:
int _my_property;
public:
[TestMethod]
void MyTestMethod()
{
MyNativeClass c;
int i = _my__property;
c.SomeMethod(i)
}
}
source
share