Hi Perry,
Perry Werneck schrieb:
Hi,

My code is in C++, but, it is designed to be called from a OOo Basic macro.
The netork stuff is running in a separated thread but it would be nice to
the starbasic developers if I can implement some kind of "waitfor" method.

The "wait" call mencioned is a great solution but it makes the development
more complex for the basic part.


If I understood you correctly, you can misuse the listener concept in Basic as following: Implement a XMyListener Interface in your Service "MyService" and a method "hasBeenDone" written in C++.

In Basic:
myService = createUnoService("com.myComp.MyService")

myListener = CreateUnoListener("ThreadStuff_", "com.myComp.XMyListener")

myService.doTheThreadStuff(myListener)

'replacement for the wait() function
do
loop until bIsDone

Function ThreadStuff_hasBeenDone() as Any
    'invoked when your Service has done the thread stuff
    'set a global variable to true
    bIsDone = true
End Function

An example you find here [1]

Regards


Peter

[1] http://www.oooforum.org/forum/viewtopic.phtml?t=29820


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

Reply via email to