几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】mydbhostappservicesdofullcrccheck90 inverse operation (http://www.dimcax.com/hust/showthread.php?t=17288)

yang686526 2009-05-06 06:17 PM

【转帖】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


所有的时间均为北京时间。 现在的时间是 02:14 AM.