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. Managed C++/CLI
  4. Stuck in Delegates and Events concept, what are the differences and when do we use them?

Stuck in Delegates and Events concept, what are the differences and when do we use them?

Scheduled Pinned Locked Moved Managed C++/CLI
helptutorialquestion
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.
  • A Offline
    A Offline
    atoi_powered
    wrote on last edited by
    #1

    When I read about delegate, I can figure out what that is and when we use that. But when I read about event, I mix things up and cannot find out how to understand the real difference and exact use of that in my codes. Every time I read about event, it gets more blur in my mind! Can you please explain that in a simple way? Thanks :)

    Richard Andrew x64R 1 Reply Last reply
    0
    • A atoi_powered

      When I read about delegate, I can figure out what that is and when we use that. But when I read about event, I mix things up and cannot find out how to understand the real difference and exact use of that in my codes. Every time I read about event, it gets more blur in my mind! Can you please explain that in a simple way? Thanks :)

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      A delegate is like a function pointer, and event is like a function. When an event is raised, it calls each delegate that is attached to it. Events are generic in that they can accept delegates that point to any function, as long as the delegates' signatures match the signature of the event. Events are points of attachment for delegates to receive calls from an object.

      The difficult we do right away... ...the impossible takes slightly longer.

      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