Urgent help needed with late binding events
-
Hi guys, I can't find this anywhere on the web after googling for hours, so the first person with the correct answer will be awarded the title of "Genius". Here's my problem: I'm doing some late binding in C# with PowerPoint (automation). I can call methods and get/set properties using Type.InvokeMember, for example:
returnObject = instance.GetType().InvokeMember(methodName, BindingFlags.InvokeMethod, null, instance, parameters);
That works just fine. But how do I subscribe to and handle events that are fired from a PowerPoint object using late binding? Can I use InvokeMethod and pass in a delegate? I have no idea. Thanks in advance, you guys are the greatest! Andy -
Hi guys, I can't find this anywhere on the web after googling for hours, so the first person with the correct answer will be awarded the title of "Genius". Here's my problem: I'm doing some late binding in C# with PowerPoint (automation). I can call methods and get/set properties using Type.InvokeMember, for example:
returnObject = instance.GetType().InvokeMember(methodName, BindingFlags.InvokeMethod, null, instance, parameters);
That works just fine. But how do I subscribe to and handle events that are fired from a PowerPoint object using late binding? Can I use InvokeMethod and pass in a delegate? I have no idea. Thanks in advance, you guys are the greatest! AndyYou can subscribe to events through the same code you had posted. Look for add_XXX and remove_XXX methods, the compiler calls them for you when you use the += and -= operators. Regards Senthil