Finaly I have found the solution. The second argument of NS_InitXPCOM2
must not be null ; it must specify the bin directory (contrary to the
examples I found).
Now I have a new problem : 'nsCOMPtr<nsIMsgAccountManager> am =
do_GetService(...)' creates a new account manager instead of returning
the account manager of thunderbird application which is launched. If
someone knows why...
Xavier.
----- Original Message -----
> I try to write a program which adds and removes accounts in
> thunderbird.
> My program is composed of two threads. The first one executes
> thunderbird like this : system("/path/to/thunderbird"). The second
> one
> tries to get the Account Manager like this :
>
> static NS_DEFINE_CID(kAccMngCID, NS_MSGACCOUNTMANAGER_CID);
>
> rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
> nsCOMPtr<nsIMsgAccountManager> am = do_GetService(kAccMngCID,
> &rv);
>
> but the 'GetService' function returns the error
> FACTORY_NOT_REGISTERED.Have someone a idea of the problem ?
>
> Thank you,
> Xavier.
>
> PS : I find a question very similar in the history of the news
> group
> (two years ago) but the solution doesn't apply
>
> For information :
> - I work with thunderbird 1.5rc1
> - the ACCOUNTMANGER_CONTRACTID is present in the file
> ~/.thunderbird/6yflq35.default/compreg.dat.
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom