Jason King <[EMAIL PROTECTED]> wrote:
> On Mar 8, 2006, at 11:52 AM, Ben Hutchings wrote:
>
>> Please can you post (or point to) the code you use for installing
>> the prompt service.
>
>
> Sorry, I just realized I forgot to remove yahoo's assertion that list  
> emails are spam.  See below for code (in 1.75):

Thanks a lot.

> // Use our own prompts instead of the Mozilla default ones
> // If this fails, we can continue
> nsCOMPtr<nsIComponentRegistrar> compReg;
> NS_GetComponentRegistrar(getter_AddRefs(compReg));
> if (!compReg)
>     DWarn("Unable to Get Component Registrar");
> else {
>     nsCOMPtr<nsIFactory> promptFactory;
>     rv = NewPromptServiceFactory(getter_AddRefs(promptFactory));
>             
>     if (NS_FAILED(rv))
>         DWarn("Unable to create Prompt Service Factory");
>     else {
>         rv = compReg->RegisterFactory(kPromptServiceCID,
>                                       "Prompt Service",
>                                       NS_PROMPTSERVICE_CONTRACTID,
>                                       promptFactory);
>         if (NS_FAILED(rv))
>             DWarn("Unable to register new Prompt Factory");
>         }
>     }

Well this is somewhat similar to what I was doing, but a different
route, so it confirmed that I wasn't too far wrong.  What I didn't
know was what to use for the two different "contract IDs", but I
Googled the names you used and turned up their definitions.

I got a bit further when I corrected the sense of the IID comparison
in the factory. ;-)

Thanks again.

Ben.

-- 
Ben Hutchings
The obvious mathematical breakthrough [to break modern encryption] would be
development of an easy way to factor large prime numbers. - Bill Gates
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to