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

exception in odcmcolor::setcolorindex()
exception in odcmcolor::setcolorindex()
hi,
the documentation of odcmcolor::setcolorindex() states that the acceptable values for the colorindex parameter are 0-257 (it takes a oduint16 parameter).
however when i pass 257, einvalidinput exception is thrown. am wriring:
code:
odcmcolor odcolor;
oduint16 index = getcolorindex(); // this gets the index based on the color in the app
odcolor.setcolorindex(index);
when index == 257, only then this exception is thrown.
interestingly, odcmcolor::colorindex() method returns a oduint8 (hence limiting its range to 0-256).
should i handle the case of 257 (odcmentitycolor::kacinone) separately?
thanks
i think that since setcolorindex() accepts bylayer index = 256 it should accept 257 (none) too.
but if the index is set to byblock, bylayer (or none).
getcolormethod() will return not byaci but byblock/bylayer/none.
if color method is byaci uint8 is enough for valid indices 1-255.
sergey slezkin
so for index == 257(none), i should handle the case separately?
'coz as of now, the code:
code:
odcmcolor color;
color.setcolorindex(257);
throws an exception, despite 257 being a valid index(odcmentitycolor::kacinone)
thanks
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)