Hi John,
When I started this project I based everything on the npsimple example in
the Mozilla directory. I used the same routines used in order to register
the
component - because this is an example that works.
The Mozilla debug output says:
nsNativeComponentLoader: autoregistering begins.
***Registering WebtermPlugin components <all right -- a generic module!>
nsPluginHostImpl ctor
nsNativeComponentLoader: autoregistering succeeded
Then later on in the debug window it then says
Components.classes['@PowerlanUSA/webterm;1'] has no properties
I have the register / unregister routines in the C code and defined in the
class WebtermPluginInstance.
I have the component info stated as:
static nsModuleComponentInfo gComponentInfo[] = {
{ "Webterm Plugin",
NS_WEBTERMPLUGIN_CID,
NS_INLINE_PLUGIN_CONTRACTID_PREFIX PLUGIN_MIME_TYPE,
WebtermPluginInstance::Create,
WebtermPluginInstance::RegisterSelf,
WebtermPluginInstance::UnregisterSelf },
};
NS_IMPL_NSGETMODULE(WebtermPlugin, gComponentInfo);
I am not sure about all the requiremements needed to register a component
either from
native code or Javascript. I hoped by following the exiting examples I could
include everything
I needed to do this. Is there anything written somewhere that outlines all
the items necessary to
do this from both Javascript or from Native code. Is there something that I
have missed in the
registering process.?
Thank you in advance for any help you can give me.
Patrick McHale
Powerlan.
"John Bandhauer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Patrick McHale wrote:
> >
> > Hi,
> >
> > I have been trying to find the answer to why a javascript error occurs
> > because of this line.
> >
> > The HTML line in question is:
> > var webterm =
Components.classes["@PowerlanUSA/webterm;1"].createInstance();
> >
> > The javascript error is:
Components.classes['@PowerlanUSA/webterm;1']
> > has no properties
> > Source File:
> > file:///C:/Mozilla/Locations/NS6AHollis.htm
> > Line: 7
> >
> > Everything works - except I get this javascript error for some reason.
> >
> > Can anyone help?
>
> This means that there is no factory registered for the contractID
> string "@PowerlanUSA/webterm;1" at the time that you run the code
> above. I would not expect you to be able to create an instance
> from C++ code for that contractID string either.
>
> Do you have code to register it from native code or JS? Are you
> not doing something to force xpcom autoregistration?
>
> John.
>
> >
> > Regards
> >
> > Patrick McHale
> > Powerlan.