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

mydbhostappservices::dofullcrccheck() inverse operation.
mydbhostappservices::dofullcrccheck() inverse operation.
hi,
i have a class mydbhostappservices which derives from oddbhostappservices, and implements the dofullcrccheck() method as below:
code:
class mydbhostappservices : public oddbhostappservices
{
public:
<snip>
virtual bool dofullcrccheck() { return false; }
<snip>
}
i would expect that with this method a crc check would not be executed, and in version 1.13.00, it was not. however, after porting the code to 1.14.01, i now get the following error while debugging:
code:
assertion failed: ncrccur == ncrc
file: source\database\dwgfiler\in\dwgfileloader.cpp
line 568
the interesting thing is that if i change dofullcrccheck() to return true, then i don't get the assertion, which is the opposite of the documentation indicates. if i remove my implementation of dofullcrccheck, then the default implementation works correctly and as documented.
sijmen.
if dofullcrccheck() returns true dwgdirect throws exception from readfile() if crc is bad.
if dofullcrccheck() returns false crc is not calculated and checked.
the effect you see is result of dd bug: crc is not calculated but is checked in debug build. as a result if dofullcrccheck returns false you get the assert for any valid file (but no exception is thrown).
release build is ok and in debug you can ignore this assert for now.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)