Hi Eike,

Eike Rathke schrieb:
Hi Regina,

On Thursday, 2009-07-09 15:47:06 +0200, Regina Henschel wrote:

(3) I have tried to use the Message of the exception. But there I fail already in the syntax.
The original exception's Message should be available as
rWrapped.TargetException.Message
I fail before that place. I do not no, how to write the throw command. A simple

throw ::com::sun::star::uno::RuntimeException("Konvergenzfehler");

does not compile.

Ah, no, there's no automatic conversion from string literals to
OUString. For ASCII strings you may use the module's STRFROMASCII(s)
that is defined in analysisdefs.hxx, so
...Exception(STRFROMASCII("convergence error")) should do.

That does not work in that way. I have earlier tried with a const OUString, which doesn't work too. But I have found my error now. You need not only the parameter for Message, but the parameter for Context too. So
...Exception(STRFROMASCII("convergence error"),NULL)
compiles.

On the other side, in addincol.cxx, I'm still not able to compare the strings. I thought something like

    if (rWrapped.TargetException.Message.equals("convergence error"))

would work, but it doesn't compile. The version with first declaring
const ::rtl::OUString sMyMessage = ::rtl::OUString::createFromAscii("convergence error");
and then using
    if (rWrapped.TargetException.Message.equals(sMyMessage))
doesn't compile too.

But because the solution with a new exception works, I'll not bother you.

kind regards
Regina




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

Reply via email to