D Fuller wrote:
>
> Hi John,
>
> I'm basically trying to get to the class factories for components.
> I'm assuming I need nsIComponentManager (a service?) and need to go through
> the service manager for this. Of course, if there is an exported function
> that would do this, I could bypass the servicemanager.
If you want to get to factories just for the purpose of creating
instances, then use
Components.classes["yourContractID"].createInstance() or one of
the variants on that listed at:
http://mozilla.org/scriptable/components_object.html#_classes
or
http://mozilla.org/scriptable/components_object.html#_Constructor
I you want to get at the nsIComponentManager interface of the
component manager for other reasons then use Components.manager
http://mozilla.org/scriptable/components_object.html#_manager
John.
>
> Sincerely,
> D
>
> "John Bandhauer" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > D Fuller wrote:
> > >
> > > Where is the IDL for nsIServiceManager? I've only found a C++ header
> file.
> > > How would one not using C++ go about obtaining a reference to it?
> > >
> > > Thanks,
> > > D
> >
> > nsIServiceManager is not expressed in idl and not directly
> > callable from anything other than C++ code. It is declared in
> > nsIServiceManager.h (which you have apparently found). In JS you
> > can create services using
> > Components.classes["yourContractID"].getService().
> >
> > http://mozilla.org/scriptable/components_object.html#_classes
> >
> > I'm not certain how other xpcom language mappings do this.
> >
> > Is this what you need? Or are you trying to do something else?
> >
> > John.