|
From: Eric E. <eri...@na...> - 2008-08-22 08:50:29
|
Hello,
On Thu, August 21, 2008 13:40, a.p. wrote:
>
> Hello.
> I try to return an error message directly from any OPER* function. Usually,
> in any catch section (at the end of XLL_DEC function description) error
> message are logged by logError() function. So return value is 0, or #NUM in
> Excel cell. Is there any way to return an error message during function
> call, instead of usage retrieveError function (like in QLXL framework by
> "Display error" option)? I tried to create a local XLOPER variable in catch
> section, such as:
>
> catch (const std::exception &e) {
> XLOPER returnValue;
> const std::string str = e.what();
> ObjectHandler::scalarToOper(str, returnValue);
> return &returnValue;
> }
> but of course it doesn't work cause the returnValue variable is local.
> Thanks.
You just need to declare returnValue as a static variable.
Regards,
Eric
-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft Excel as a client
to the Grid
|