Andreas Schlüns a écrit :
Hello Julien,
What about my other proposed solution? Use a job and register your
service before any UI is visible.
I will remember this solution. I have set it aside for the time
being, because a job must be registered again in some OO
configuration file (typically in the .xcu of a package), and that is
precisely the kind of thing we try to avoid. We want to register
everything dynamically.
They only way to get a notification about the first opened visible
document is using of the job mechanism. OK - you can register any UNO
listener on the gloabl css.document.GlobalEventBroadcaster instance
(such broadcaster provides any notification about
loading/storing/changing office documents) ... but how you will
trigger your own listener registration ? Hardly coded inside main() ?
But there exists a direct binding between the GlobalEventBroadcaster
and the job execution. Jobs can be registered for events (e.g.
OnStartApp).
Of course registration of such jobs can be done using the
configuration only.
You said (some postings before) you dont install an AddOn .. you wish
to patch the office "dynamicly at runtime". How do you do that ?
Regards
Andreas
Hi Andreas,
I am sorry to answer so late, I was away for 5 weeks.
Yes, I register my add-on dynamically through a system hook, not an
official and portable API mechanism (though I would be glad if there
were any).
That is :
- Without any modification of OO configuration file, I detect OO's boot
by a system hook.
- On some systems (such as Windows), such hooks also enable me to inject
any DLL in OO's process (then this DLL executes within OO's process).
- Then I must somehow induce OO to register dynamically this DLL as an
add-on. Under Windows, I use OLE to do this, the only way I have seen to
call OO, since I don't have any reference to OO's service manager at
this point.
On other systems, maybe it could also be done if OO is scriptable under
the corresponding system.
- OO registers my DLL and during the call to 'component_getFactory', it
passes a reference on its service manager. Done.
But it is true that all this processing can only occur quite late after
OO's boot, particularly after OO has read its configuration file, and
that is the problem mentioned in my previous posts.
Julien Galand
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]