![]() |
【转帖】error while exporting to dwg
error while exporting to dwg
error while exporting to dwg i recently upgraded from dwgdirect 1.14 to 2.01. the following code exports the file to dxf correctly. odwrfilebuf outfile ((odchar*)pfilename); m_pdb->writefile (&outfile, oddb::kdxf, oddb::vac15, true); but, when i use the following code to export to dwg - odwrfilebuf outfile ((odchar*)pfilename); m_pdb->writefile (&outfile, oddb::kdwg, oddb::vac15, true); it gives an error. the error code is enotapplicable. appreciate your help. thanks, kedar i get the same error for dwgdirect 2.5.1 as well. thanks, kedar any file? if not, can you attach the file? vladimir yeah, any file. even an empty file with no entities throws the aforementioned exception when exported to dwg. thanks, kedar perhaps you can reproduce it in some of our samples? or attach complete code to reproduce the problem. (it is hard to say anything by the lines you quoted) vladimir savefile (bstr filenameptr, int filetype, int fileversion) { afx_manage_state(afxgetstaticmodulestate()) begin_sexception_handling cstring filename(filenameptr); const char * pfilename = filename; odwrfilebuf outfile (pfilename ); oddb::savetype newfiletype = filetype == 0 ? oddb::kdwg : oddb::kdxf; oddb:wgversion newversion; switch (fileversion) { case 5: newversion = oddb::vac13; break; case 6: newversion = oddb::vac14; break; case 7: newversion = oddb::vac15; break; default: case 8: newversion = oddb::vac18; } auditinfo aiappaudit; aiappaudit.setfixerrors(true); aiappaudit.setprintdest(oddbauditinfo::kboth); m_pdb->auditdatabase(&aiappaudit); // fails for dwg... dxf works fine m_pdb->writefile (&outfile, newfiletype, newversion, true); return s_ok; end_sexception_handling } there is no other special code that differentiates exporting to dwg and dxf. appreciate your help. thanks, kedar btw, this worked fine in 1.14. i still cannot reproduce the bug. perhaps you can attach a complete (compilable) sample here or send it by email (vkalinin at softdev spb ru) btw: what compiler you are using? do you use static or dynamic libraries? vladimir i link files from vc8md. i believe those are dynamic libraries. i am compiling on vs2005 with dwgdirect 2.01 or dwgdirect 2.5.1. both give me the same error. my project settings in the linker include: additional library directories: /lib/vc8md additional dependencies: dd_vc8md_acisbuilder.lib dd_vc8md_alloc.lib dd_vc8md_br.lib dd_vc8md_db.lib dd_vc8md_dbcommands.lib dd_vc8md_ft.lib dd_vc8md_ge.lib dd_vc8md_gi.lib dd_vc8md_gs.lib dd_vc8md_jpeg.lib dd_vc8md_modelergeometry.lib dd_vc8md_root.lib dd_vc8md_rxplotstyleservices.lib dd_vc8md_rxrasterservices.lib dd_vc8md_sm.lib dd_vc8md_spatialindex.lib dd_vc8md_svgexport.lib dd_vc8md_zip.lib dd_vc8md_zlib.lib gs_wingdi.lib gs_winopengl.lib version.lib these are static libraries (using dinamic crt). that configuration is checked by our tests, and saving ro r15 dwg is tested as well. something must be wrong in your application. the major change in 1.14 -> 2.0 was transition to unicode. some virtual functions has changed because of that. perhaps some function that was overloaded, now is not? as i said earlier - a complete sample woud be helpful. vladimir okay.. i will post the gist of the code to you in a day or two. but i wonder why the same code works for exporting to dxf and fails when exporting to dwg.. btw, i could compile my vc6.0 code on vs2005 using dwgdirect 1.14 & it failed to register the output dll. is there any way i can remain on 1.14 & compile/run my c++ code on vs2005..? thank you quote: originally posted by kedark btw, i could compile my vc6.0 code on vs2005 using dwgdirect 1.14 & it failed to register the output dll. is there any way i can remain on 1.14 & compile/run my c++ code on vs2005..? not sure i understand you, - it's your dll that failed to register isn't it? vladimir hello wyk, lemme summarize what i am intending to do here.. just to give you the bigger picture... case 1:i have a c++ project linked with dwgdirect 1.14. i used to compile/link this project using vc6.0; generate an output dll to import/export dwg/dxf files. i have no errors/problems with this dll at all. case 2:now, i intend to move that project to vs2005. i could compile/link it in vs2005 just fine using the same dwgdirect 1.14, but the output dll fails to register. i will send you the exact error description tomm. case 3:however, if i try to compile/link using dwgdirect 2.5.1 in vs2005 (of course, i had to change my code to suit the changes made in 2.5.1) , it compiles/links/registers the dll; but i run into different issues (some of them are stated in this forum). i am not that interested in shifting to 2.5.1 right now, my first priority is to run my old project using vs2005 i.e. turn case 1 to case 2. so, it would be okay for me to get case 2 working. so, is it possible to build a project on vs2005 using 1.14 ? in other words, does builing a project on vs2005 imply a mandatory shift to 2.5.1? if not, what changes have to made so that i can continue to use 1.14 on vs2005 ? thanks for your help. quote: so, is it possible to build a project on vs2005 using 1.14 ? as a rule, you should use libraries built for the compiler you use - that is, for 2005 you should use dd_vc8md_*.lib if you don't have them, you are out of luck, i doubt we have preserved libraries that old. sometimes though, you may use older libraries with a new compiler. quote: but the output dll fails to register. i will send you the exact error description tomm. i'll wait for it vladimir i have the dwgdirect 1.14 libraries. when i use 1.14 libraries on vs2005, i get the following error while registering the dll. "r6034 - an application has made an attempt to load the c runtime library incorrectly." this is a part of buildlog results from vs2005. compiling manifest to resources... linking... .\dwgutils.def : warning lnk4222: exported symbol 'dllcanunloadnow' should not be assigned an ordinal .\dwgutils.def : warning lnk4222: exported symbol 'dllgetclassobject' should not be assigned an ordinal .\dwgutils.def : warning lnk4222: exported symbol 'dllregisterserver' should not be assigned an ordinal .\dwgutils.def : warning lnk4222: exported symbol 'dllunregisterserver' should not be assigned an ordinal creating library .\debug/dwgutils.lib and object .\debug/dwgutils.exp link : warning lnk4098: defaultlib 'msvcrt' conflicts with use of other libs; use /nodefaultlib:library dd_vc6md_alloc.lib(odallocop.obj) : warning lnk4217: locally defined symbol ??0bad_alloc@std@@qae@pbd@z (public: __thiscall std::bad_alloc::bad_alloc(char const *)) imported in function "void * __cdecl operator new(unsigned int)" (??2@yapaxi@z) executiveservices.lib(biguint.obj) : warning lnk4204: 'c:\dev\projects\current\dwgutils\debug\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info executiveservices.lib(executiveservices.obj) : warning lnk4204: 'c:\dev\projects\current\dwgutils\debug\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info embedding manifest... creating browse information file... microsoft browse information maintenance utility version 8.00.50727 copyright (c) microsoft corporation. all rights reserved. performing registration project : error prj0019: a tool returned an error code from "performing registration" thanks. |
所有的时间均为北京时间。 现在的时间是 12:06 AM. |