几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】singledoc Access Violation (http://www.dimcax.com/hust/showthread.php?t=18599)

yang686526 2009-05-07 04:00 PM

【转帖】singledoc Access Violation
 
singledoc : access violation
singledoc : access violation
hello
i can't read any dwg file after reading dwg file with paper space.
void csingledocview::resetdevice(bool zoomextents)
{
:
m_pdevice = pgs->createdevice(); //occur 0xc0000005 access violation
:
}
dwgdirect version 2.06.01
attached files
that is - you opened the first file with singledoc example, and then, opening the second you've got an exception?
vladimir
i got the same problem
quote:
originally posted by vkalinin
that is - you opened the first file with singledoc example, and then, opening the second you've got an exception?
hi vladimir
i got the same problem.
-----------------------
tauhid
i was able to reproduce the crash.
you may use teh following fix: replace csingledocdoc::onopendocument with the following code
code:
bool csingledocdoc::onopendocument(lpctstr lpszpathname)
{
if (!cdocument::onopendocument(lpszpathname))
return false;
/**********************************************************************/
/* load the specified dwg file into the database, allow code page */
/* conversion disallow partial load. */
/**********************************************************************/
try
{
if (!m_pdb.isnull()) // clear gs model associated with the previous database
{
position pos = getfirstviewposition();
while (pos)
{
csingledocview* view = (csingledocview*)getnextview(pos);
view->m_pdevice = 0;
view->m_pprinterdevice = 0;
}
}
m_pdb = theapp.readfile(lpszpathname, true, false);
}
catch(oderror& /*e*/)
{
}
catch(userbreak)
{
return false;
}
return true;
}
vladimir
thanks vladimir
it works..
have a nice day~


所有的时间均为北京时间。 现在的时间是 06:10 PM.