I am working on wrapping a large number of .h and .lib files from native C++ to Managed C++ for eventual use as a referenced .dll in C#.
Some of the native C++ functions have a return type of void*. I am not sure how to handle this when I pass back the value to my calling code. For instance: if a C# app calls my dll wrapper, what do I return from the native call:
void* start(ThreadFunc,void *, unsigned *);
I am currently attempting to box the return in a generic System::Object^ with no luck. This is the call in the wrapper:
m_NativeThread->start(cb,
GCHandle::ToIntPtr(GCHandle::Alloc(o)).ToPointer(),
static_cast<unsigned int*>(GCHandle::ToIntPtr(GCHandle::Alloc(u)).ToPointer())));
Can anyone offer a solution?
Thanks.