查看单个帖子
旧 2009-05-05, 09:35 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】error descriptions

error descriptions
error descriptions
hi,
i can't seem to be able to get hold of the string describing an error when it is thrown. my code is:
catch (const oderror& e)
{
odstring s = e.description();
showerrorstr(s, e.code()); // routine coded elsewhere
return false;
}
if i put a breakpoint on the call to showerrorstr, the odstring s is always empty (the error code in this particular case was einvalidinput). what have i done wrong? i am using v2.0.3 of the libraries.
thanks in advance,
ali smith
set a breakpoint in exsystemservices::formatmessage if you are using our exsystemservices class, or in your formatmessage overload in your systemservices class, and see what's get formatted for einvalidinput.
vladimir
hi, that pointed me at the problem - i'd commented out the formatmessage function contents, to get round a build issue, and forgotten to put the code back in! thanks for the help.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)