The following code is on a Base form and its purpose is to open another Base form of the same ODB file and set a closing event listener:

[code]
1 Sub openForm
2 Dim form
3 Dim prop(2) as New com.sun.star.beans.PropertyValue
4   prop(0).Name="ActiveConnection"
5   prop(0).Value=ThisComponent.Parent.DataSource.getConnection("","")
6   prop(1).Name="OpenMode"
7   prop(1).Value="open"
8   prop(2).Name="MacroExecutionMode"
9   prop(2).Value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
10 form=ThisComponent.Parent.FormDocuments.loadComponentFromURL("someForm","_default",com.sun.star.frame.FrameSearchFlag.CREATE,prop()) 11 form.addEventListener(CreateUnoListener("customListener_","com.sun.star.lang.XEventListener"))
12 End Sub
[/code]

The code works in OOo 2.4.1 under XP and Ubuntu 8.04.

But with OOo 3.0RC2 the following error appears in line 11 after "someForm" has been opened:

[error]
BASIC runtime error.
An exception occurred
Type: com.sun.star.lang.IllegalArgumentException
Message: cannot coerce argument type during corereflection call!
[/error]

Anyone knows what changed in UNO API to cause this error?

Thanks.

--
Manolis Christodoulou MD
[EMAIL PROTECTED]

http://mobi-doc.com
http://palmpowereddoctor.blogspot.com

For document attachments...
PREFER: ODF, PDF, PDF/A.
 AVOID: DOC, RTF, OOXML.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to