天天看點

(.net) 使用反射獲得 dll 的 HINSTANCE

// use reflection to get the dll HINSTANCE

Assembly assembly = Assembly.GetExecutingAssembly();

Module current = assembly.GetModules()[0];

IntPtr module = Marshal.GetHINSTANCE(current);