几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】is dwgdirect safe for server side use (http://www.dimcax.com/hust/showthread.php?t=16937)

yang686526 2009-05-06 04:13 PM

【转帖】is dwgdirect safe for server side use
 
is dwgdirect safe for server side use?
is dwgdirect safe for server side use?
thanks for a great library.
i'm using dwgdirect1.09 in server side code and i'm experiencing problems when multiple threads are instantiating the lib. can i use it in this scenario?
if you some notes on what to lookout for i would appreciate this.
thanks!
/jonas
here's the entry point:
void parser::run( const tstring& spath, reactor& r )
{
class initlib
{
public:
initlib( odstaticrxobject<myservices>* svcs )
{
odinitialize( svcs );
}
~initlib()
{
oduninitialize();
}
};
try
{
odstaticrxobject<myservices> svcs;
svcs.disableoutput(true);
try
{
initlib init(& svcs);
processdwg( svcs, spath, r );
}
catch(oderror& e)
{
tstring serror;
serror = _t("dwgdirect :");
serror += svcs.geterrordescription(e.code()).c_str();
throw wd3::error( serror, e_fail ); //todo fix
}
}
wd3_catch_throw_all( _t("parser::run") )
}
solved
fyi: i'm stupid... my code calls odinitialize and oduninitialize per thread call and not once per process as stated in the documentation, after changing this everything works.
/jonas


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