OnReadyStateChange event in ActiveX controls

activexcom

I wrote a Firefox plugin (only compatible with FF3 atm) that allows the hosting of ActiveX controls.
Before the flaming begins – this is not the main topic for this question and the plugin was designed with security in mind so it doesn't break my favorite browser. if you are interested, it's hosted at http://code.google.com/p/ff-activex-host/.

Now, I've noticed that in IE all ActiveX controls have an event called OnReadyStateChange available, however, not all ActiveX controls have that event listed in their TypeLib. As a result, my plugin cannot register handlers for this event for every ActiveX control.

Opening such controls with OleView, I can't find the OnReadyStateChange event either – leading me to believe that IE might be 'cheating' here to make it work. When OleView shows such a handler (as with the Shockwave ActiveX control), I have no troubles registering handlers for it.

An example of such a control is Microsoft's Terminal Services ActiveX. But it's not a problem limited to MS ActiveX controls.

I am not an expert on COM Objects, am I searching for the event in a wrong way or at the wrong place?
Right Now I think I'm doing it right, since OleView can't find it either, so…

Can I somehow 'cheat' the same way IE does and make this event available anyway?

Best Answer

Yes IE will be cheating. What you actually have in IE is what in the COM world we call an aggregate object. IE will have create an instance of a COM class that it uses to represent ActiveX objects and will aggregate that with the actual instance of the ActiveX class, creating a composite object.

This composite appears to be a single object with new features.

Hence I don't think you need worry about OnReadyStateChange at all.

Related Topic