I was able to fix the macro to use the same service with startThr and stopThr buttons. Thanks for your help Stephan and Michael. Neeraj -----Original Message----- From: Rai, Neeraj [ICG-MKTS] Sent: Wednesday, February 13, 2013 1:03 PM To: 'Michael Stahl' Cc: 'Stephan Bergmann'; 'libreoffice@lists.freedesktop.org' Subject: RE: [libreoffice-dev] -calling a service function from BASIC macro Hi Michael, The links clear up some doubts in my mind. I am still having trouble with having 2 buttons to act on the same service (this is a new problem report). I created 2 buttons which calls startThr() and stopThr() on my service. The start works as expected. However, the stop call seems to create a new service and fails to stop it. I tried using a global service variable (button.macros attached), but it is giving me syntax error on line 1 "expected Sub ". I used the attached burger_samples.macros as sample for my macro but I might have made some obvious mistakes as this is my 1st macro. I have also found a book on macros by Andrew Pitonyak and going through it. Are there are any other resources I could use? thanks Neeraj
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
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).
Attachment:
startThr.macros
Description: startThr.macros