I finaly succeeded in doing what I expected. For those who are
interested, here is the solution.
Two threads :
- the first one executes thunderbird
- the second one interacts with thunderbird throw XPCOM
Because Thunderbird has to be in the same process as the treatment
thread, it should not be executed with :
system("thunderbird")
but calling directly the main function
XRE_main(...)
[defined in toolkit/xre/nsXULAppAPI.h and libxulapp_s.a]
[for the arguments, see mail/app/nsMailApp.cpp]
The second thread must wait until XPCOM is initialized by the first
thread. After that, it can call do_GetService directly ; nothing else.
Notice : I execute Thunderbird without calling the thunderbird script.
I only defined LD_LIBRARY_PATH ; that seems to work...
Thank you Christian for help.
> > 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...
>
> That's because it's in a different process... you can only use
> XPCOM to
> access services and such in the same process. (Unless you use the
> experiemental DConnect stuff, which isn't enabled by default, and
> which
> hasn't been worked on for a while...)
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom