Hello Marc,
Alle 14:50, sabato 6 ottobre 2007, Marc Santhoff ha scritto:
> Hi,
>
> when running this macro:
>
> <BASIC>
> global doc as object
>
> sub LockerCheck
> dim args(1) as new com.sun.star.beans.PropertyValue
>
> doc = ThisComponent
> args(0).Name = "xInstance"
> args(0).Value = doc
> args(1).Name = "nActions"
> args(1).Value = 1 'com.sun.star.embed.PREVENT_CLOSE
> psm = GetProcessServiceManager()
> lck =
> psm.createInstanceWithArguments("com.sun.star.embed.InstanceLocker",
> args()) if NOT IsNull(lck) then lck.dispose()
> end sub
> </BASIC>
>
> the answer is not 42 but a messagebox saying:
>
> css.lang.IllegalArgumentException
> Nonempty reference is expected as the first argument!
>
> In parallel to the IDE there is only one writer doc opened for filling
> "ThisComponent" with something useful.
>
> What's going wrong here?
>
It seems that the problem is in the way in which you are passing arguments.
I've tried in this way:
sub LockerCheck
doc = ThisComponent
psm = GetProcessServiceManager()
args() = Array(doc, 3)
lck = _
psm.createInstanceWithArguments("com.sun.star.embed.InstanceLocker", args())
end sub
No error are raised in this case, and I'm quite sure that arguments are
correctly processed .....but I've got some crashes :-(
It seems that there are further problems, please check.
BTW what are you trying to achieve with this code? (I'm curious :-)
ciao
Paolo M
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]