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