Hi Michaelm

> Thanks for your answer. The StringResourceWithLocation service is
> exactly what I was looking for. I also found some helpful example
> code under http://markmail.org/message/sv2z4cvsgmgyctht, but it does
> not work yet because I do need a Component Context which I do not
> have (the drivers main class has a constructor with a parameter for
> the Component Context, but the constructor is called with null for
> this parameter) and I could not bootstrap for some reason

bootstrapping is no good idea, anyway, you'd have two of them in the
same process then, if it would work at all.

The driver's ctor is not the top-level entry point into your component,
but a C function "component_getFactory" is. This creates a
XSingleServiceFactory which is invoked when an instance of your driver
is requested. Depending on how you implemented this function (basically:
which helpers you used), this invocation is delegated to somewhere else.
Usually, this is either a static method at your driver, or some global
function. (naming conventions suggest something like Driver::Create or
Driver_CreateInsrance.) Both of those usually take a
XMultiServiceFactory parameter.

If you're inside an OOo build environment, you have access to
comphelper::ComponentContext, which you can create using the MSF.
Otherwise, query the MSF for the XPropertySet interface, and retrieve
the "DefaultContext" property. This way, you get an XComponentContext
instance which you should use all across your driver implementation.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         frank.schoenh...@sun.com -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org

Reply via email to