Again, coming from the Microsoft ATL/com side of things.... Most activeX
controls export an interface through IDispatch if they expect to be
scripted. This is because VBScript and JavaScript use this interface to get
the object methods.

I know that at least with an ATL activeX control, the browser calls
QueryInterface() and gets the IProvideClassInfo2 interface.
IProvideClassInfo2  provides a method for getting the type information for
the ActiveX control's coclass entry in its type library.

I think then you use IProvideClassInfo2 to get the ITypeInfo interface.

-Paul


 -----Original Message-----
From:   Adam Lock [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, October 24, 2001 6:55 PM
To:     [EMAIL PROTECTED]
Subject:        Re: registering XPCOM interfaces on the fly?

Oswald, Paul wrote:

>Adam,
>
>I don't really know the issues involved on the mozilla side of things, but
I
>think you are trying to build a typelib in mozilla from an ActiveX control
>to use at runtime, correct?
>
>I am pretty sure that ActiveX typelibs are not the way to go. My
>understanding of typelibs (I am an ATL programmer) is that they are used in
>early binding at design time. I think for late binding you want to query
the
>object for a list of interfaces using GetIDsOfNames() followed by a call to
>Invoke(). This is usually done through the IDispatch interface that the
>ActiveX object exposes for scripting clients.
>
>- Paul
>
Basically I need the control's typeinfo in order to construct a 
corresponding XPCOM interface which has the same number of methods, 
arguments (of the correct type) as the original interface. GetIDsOfNames 
just gets me a list DISPIDs corresponding to a list of names thatI must 
supply. Unfortunately I don't know what list of names  are until I read 
the typelib (or the plugin implements a XPCOM IDispatch-like interface 
that is called with one supplied) so its nearly unavoidable.


Reply via email to