Hello all, I have a 3rd party collection of .h files along with the .lib files that go with them. I am wrapping those native C++ files with a C++/CLI wrapper and making final calls from C#. I have an issue when I call methods that expect a reference to be passed in where the value is not getting changed in my wrapper unless I explicitly change it.
My C++/CLI wrapper code currently looks like this:
bool get_testInt16(int16% testInt16)
{
int16* t = static_cast<int16*>(GCHandle::ToIntPtr(GCHandle::Alloc(testInt16)).ToPointer());
bool b = m_NativeCMTY_TestData->get_testInt16(*t);
testInt16 = *t;
return b;
};
And the corresponding native C++ code looks like:
bool get_testInt16(int16 &testInt16);
I figure there's gotta be a better way, but maybe not? Let just say I'm HOPING there's a better way!