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

yang686526 2009-05-06 11:33 PM

【转帖】problem with saving as dxf r15
 
problem with saving as dxf r15
problem with saving as dxf r15
hello,
i use dwgdirect 1.13,
i'm having problems with saving attached file as dxf in ver. r15 (oddb::kdhl_1015).
i use following code to open the file:
code:
//oddbdatabaseptr m_pdb;
//cstring filename; source file name
m_pdb = oddbhostappservices::readfile(filename, true, false, oda::ksharedenyno, odpassword());
and then i try to save file using:
code:
//cstring stroutfilename; output file name
m_pdb->writefile( &odwrfilebuf(stroutfilename),
oddb::kdxf, oddb::kdhl_1015, false);
after saving i get an error saying: "was open for write" .
please, advice me, if there is a solution for this problem.
with regards,
przemek sawicki
attached files
both odamfcapp and odcopyexsample save the file to dxf 15.
the reason is in your code between reading and writing the file. it seems you opened some object, modified it and the object was not closed before calling writefile().
probably you have some smart pointer to modified object.
modified object gets closed than the last smart pointer to it goes out of scope or gets zeroed.
sergey slezkin


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