Reputation: 2701
I'm grabbing the HINSTANCE of a c# form using:
IntPtr hinstance = Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]);
I'm then trying to pass it on to a C++/CLI component. I'm pretty sure this is a dumb question, but how in C++ CLI do you convert from an IntPtr to an HINSTANCE?
Upvotes: 1
Views: 1432
Reputation:
Call ToPointer()
on it, you'll get a void*
. That should be assignable to an HINSTANCE
.
Upvotes: 3