我想这一点:如何在ThreadContext类中获取MethodInfo?
Type ThreadContextType = typeof(Application).GetNestedType("ThreadContext", System.Reflection.BindingFlags.NonPublic);
MethodInfo FDoIdleMi = ThreadContextType.GetMethod("FDoIdle", BindingFlags.NonPublic |
BindingFlags.Instance, null, new Type[] { typeof(Int32) }, null);
ThreadContextType是好,但FDoIdleMi为空。我知道GetMethod调用有问题,因为FDoIdle来自UnsafeNativeMethods.IMsoComponent接口。
如何做到这一点?谢谢。
我曾尝试与UnsafeNativeMethods.IMsoComponent.FDoIdle但忘记了System.Windows.Forms前缀。感谢那。 – 2008-10-18 16:37:54