views:

124

answers:

1

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?

+2  A: 

Call ToPointer() on it, you'll get a void*. That should be assignable to an HINSTANCE.

jdv