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. ATL / WTL / STL
  4. ATL - Raise Event to all clients and acces to same variable

ATL - Raise Event to all clients and acces to same variable

Scheduled Pinned Locked Moved ATL / WTL / STL
c++hardwaretutorialquestion
3 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.
  • L Offline
    L Offline
    ljubek74
    wrote on last edited by
    #1

    I'm working on attributed ATL DLL which establish communication with some hardware. I need to raise event in all clients when hardware signals. Also, I would need to have access to same variable from all clients. This variable actually holds registers from hardware. Can someone point me in right direction how to accomplish this? I have a hardware communication code ready just need to figure out how to rise event in all clients and have them read same register variable. Thank you. Ljube

    B 1 Reply Last reply
    0
    • L ljubek74

      I'm working on attributed ATL DLL which establish communication with some hardware. I need to raise event in all clients when hardware signals. Also, I would need to have access to same variable from all clients. This variable actually holds registers from hardware. Can someone point me in right direction how to accomplish this? I have a hardware communication code ready just need to figure out how to rise event in all clients and have them read same register variable. Thank you. Ljube

      B Offline
      B Offline
      barneyman
      wrote on last edited by
      #2

      Create your class as a singleton, you need to make it an event source, and the consumers an event_receiver - there's an example here on CP As far as the common variable is concerned, you can either pass it byvlaue in the event, or expose it as a property/via a method You'll have to put some locking in the singleton too, to stop your host changing the value while the clients are looking at it

      L 1 Reply Last reply
      0
      • B barneyman

        Create your class as a singleton, you need to make it an event source, and the consumers an event_receiver - there's an example here on CP As far as the common variable is concerned, you can either pass it byvlaue in the event, or expose it as a property/via a method You'll have to put some locking in the singleton too, to stop your host changing the value while the clients are looking at it

        L Offline
        L Offline
        ljubek74
        wrote on last edited by
        #3

        Thanks. First tests looks promising! Ljube

        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