Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Urgent help needed with late binding events

Urgent help needed with late binding events

Scheduled Pinned Locked Moved C#
helpquestioncsharpwpfwcf
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BigAndy
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • B BigAndy

      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

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      You 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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups