[libreoffice-dev] -calling a service function from BASIC macro
Michael Stahl
mstahl at redhat.com
Wed Feb 13 04:41:04 PST 2013
On 12/02/13 16:31, Rai, Neeraj wrote:
> Hi Stephan,
>
> Is there any example of using uno calls from the forms bundled with LO ?
> I am not very familiar with the Reference <> and googling uno::Reference is not helping me either.
> I also couldn't find usage in sdk dir and examples dir. Would it be possible to point out a dir/file or a web link.
please read this chapter:
http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/C%2B%2B/C%2B%2B_Language_Binding
and especially:
http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/C%2B%2B/Mapping_of_Interface_Types
> I also wanted to understand the lifetime of uno objects .
> Does the CalcAddimThr_impl object live for the life of open doc ?
> I tried to keep my object without reference counting as there is only one instance of it and I am unfamiliar with Reference.
> The runThread was passed the same pointer that I assumed with live for the life of open scalc doc.
> But you seem to be suggesting that some other reference counted object is going out of scope making the pointer dangling.
it is generally unsound to retain a plain C++ pointer to an object after
the first uno::Reference for it has been constructed. (you may retain a
rtl::Reference however, which is often convenient because it can contain
your implementation class directly and not just some UNO interface).
More information about the LibreOffice
mailing list