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. Visual Basic
  4. bubbling events up.....is there a better approach?

bubbling events up.....is there a better approach?

Scheduled Pinned Locked Moved Visual Basic
c++comtutorialquestion
1 Posts 1 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.
  • M Offline
    M Offline
    MartinOrtiz
    wrote on last edited by
    #1

    A common scenario is using controls made in VC++ and incorporated and nested into a composite control in VB... For example FooActiveX-->VB Composite UserControl-->WrapperVB Control--->WindowsForm In the past, I've read the recommendation is to bubble up events received by FooActiveX --> WindowsForm. But have found in practice, that this can be a maintenance nightmare come true. For example you would have to raise events up in each one in the chain... FooActiveX--(raise event)-->VB Composite UserControl--(raise event)-->WrapperVB Control---(raise event)-->WindowsForm and worse is the reverse, when you have to communicate back downward by calling and bubbling method calls downward WindowsForm---(DoFooRefresh)-->WrapperVB Control--(DoFooRefresh)-->VB Composite UserControl-- (DoFooRefresh)-->FooActiveX Is there a sane way to have your cake and eat it too? That is, to maintain some kind of OO paradigm by making / using nicely encapsulated composite ActiveX controls of this nature, without this messy chain messaging going on? ie....BROADCAST event, where only WindowsForm....will listen in and care about event and the reverse, BROADCAST a message/command down so ideally we would end up with these two instead FooActiveX--(BROADCAST event)-->WindowsForm WindowsForm---(BROADCAST command DoFooRefresh)-->FooActiveX

    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