Events from multiple COM objects into same form
Posted on 2002-05-20
I have a com object that has a callback interface. I would like to have multiple com objects instanced in a form with all of them having their callback interfaces sinked on that form.
The way I have tried to do it so far is to have a tmp variable defined public with events on the form and I new multiple objects onto that varaible (being sure to store the objects onto a collection). The problem I am having is that as soon as I new a new object, the old object releases.
How do I keep multiple objects firing events into the same form? Im guessing I need to up the ref count on the object so it doesn't go away? How do I do that?