On Thu, 14 Jun 2001 20:36:38 GMT, Steven Katz <[EMAIL PROTECTED]>
wrote:
>
>I switch to the MIME type you suggested below and that brought back the dialog
>box that said no plugin for "application/x-java-vm".
sorry - mixed up the plugin registration with the component
registration.
>Using the original MIME type I managed to trace the problem in the browser to
>something that make no sense to me but here goes:
>
>It appear that the Create() function that is specified in the components
>structure is used by the browser to create both the factory and the things that
>the factory is suppose to create.
>
>So what was happening was the browser was calling the create function with an
>IID set to nsIPluginInstance and that was failing.
>
>That failure resulted in a fall through to code that opens the .so and looks for
>a NSGetFactory() function [which is now deleted from my code]
>
>Any idea why the browser doesn't:
>
>1) Create component instances by calling the CreateInstance() function that is
>specified by the nsIFactory interface directly?
If you have your own nsIFactory then you might want to forego the
generic NS_IMPL_NSGETMODULE and put together your own nsIModule.
The SimplePluginInstance is very simple - generic module (by way of
the macro) and no standalone factory.
If you have an nsIFactory/nsIPlugin impl, then you can roll your own
nsIModule. In its GetClassObject impl, create your factory and return
it. You'll also have to do your own component registration/unreg and
export your own rolled NSGetModule.
For an example of a handrolled module like this, see
http://lxr.mozilla.org/seamonkey/source/content/build/nsContentModule.cpp
It doesn't have the plugin registration but it's probably more inline
with what you need in regard to nsIModule impls.
Also check out what the NS_IMPL_NSGETMODULE macro eventually ends up
creating on your behalf:
http://lxr.mozilla.org/seamonkey/source/xpcom/components/nsGenericFactory.cpp
>2) Seem to use the GetMIMETypes() function at all?
It should already have the mimetypes by virtue of the plugin
registration with the plugin manager (as in the
SimplePluginInstance::RegisterSelf impl).