D
Dilip
What is the best way to get a void* out of System.Object^?
Right now this is the way we go:
MyRefClass^ myreftype = ; // from somewhere
void* opaqueObj =
GCHandle::ToIntPtr(GCHandle::Alloc(myreftype)).ToPointer();
when we unpack:
void* p = //........
GCHandle ourWrapper = GCHandle::FromIntPtr(safe_cast<IntPtr>(p));
MyRefClass^ ourObject = ourWrapper.Target;
I am wondering if I can eliminate GCHandle from the picture and get to
what I want? There is a deeper problem w.r.t passing GCHandle between
appdomains and I was wondering if there is a simple out of this mess.
Right now this is the way we go:
MyRefClass^ myreftype = ; // from somewhere
void* opaqueObj =
GCHandle::ToIntPtr(GCHandle::Alloc(myreftype)).ToPointer();
when we unpack:
void* p = //........
GCHandle ourWrapper = GCHandle::FromIntPtr(safe_cast<IntPtr>(p));
MyRefClass^ ourObject = ourWrapper.Target;
I am wondering if I can eliminate GCHandle from the picture and get to
what I want? There is a deeper problem w.r.t passing GCHandle between
appdomains and I was wondering if there is a simple out of this mess.