Hi Daniel,

> IMO it doesn't matter whether you create that data (mostly the
> implementation name) at the point of loading the library or slightly
> later when the UNO service needs to be instantiated.

It might be everything from "slightly later" to "never" (because perhaps
sevice Foo from lib A is needed, but Bar isn't at all).

I used to use the following pattern to prevent this:

- implement
  extern "C" void SAL_CALL createServiceInfo_Foo()
  {
    static sdecl::ServiceDecl const myDecl(
      sdecl::class_<MyImpl>(),
      "org.openoffice.Foo", "org.openoffice.comp.Foo" );
  }
  beside my service implementation
- call createServiceInfo_Foo from within component_* functions, for
  every implementation in the library

This is slightly more uncomfortable than a global variable, but should
prevent all its drawbacks.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to