Hi Bernard, Alex,

com::sun::star::lang::XEventListener is not deprecated.
The problem looks to be that the document implements two "addEventListener()" methods that differ only by the type of the provided argument. You need the one that gets com::sun::star::lang::XEventListener.

If I am not wrong there was a solution for Basic that has allowed to resolve the ambiguity. Unfortunately I can not currently remember how exactly should it look like.

Best regards,
Mikhail.

On 04/29/09 13:29, Bernard Marcelly wrote:
Hi Alex,
According to the IDL documentation, XEventListener is deprecated.
Use (still unpublished) XDocumentEventListener.
<http://api.openoffice.org/docs/common/ref/com/sun/star/document/XDocumentEventListener.html>

Regards
  Bernard

Message de Alex P  date 2009-04-29 12:37 :
Hello!
I've got a Problem with the registration of my Event-Handler since I installed OpenOffice.org 3. My Basic script to register my simple Eventhandler seems to be obsolete and I dont find the correct fix for this. I only want to capture the Close of my Document to sent a message to my application.


Here my old script (from an old OO example), which produces this Exception:

Type: com.sun.star.lang.IllegalArgumentException
Message: cannot coerce argument type during corereflection call!


Sub StartCloseListening()
 oDoc = ThisComponent
oEventListener = CreateUnoListener( "DocCloseListener_", "com.sun.star.lang.XEventListener" ) oDoc.addEventListener( oEventListener ) <--- Here comes the exception!!
End Sub

Sub DocCloseListener_disposing( oEvent )
 AutoClose()
End Sub


Thanks for Help

Alex P.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



--
Sun Microsystems GmbH                Mikhail Voytenko
Nagelsweg 55                         Software Engineer
20097 Hamburg                        Phone: (+49 40)23646 500
Germany                              Fax:   (+49 40)23646 550
http://www.sun.de                    mailto:[email protected]

Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Dr. Roland Bömer
Vorsitzender des Aufsichtsrates: Martin Häring


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to