高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】problem about convert 1.12 to 1.13
problem about convert 1.12 to 1.13
problem about convert 1.12 to 1.13
i use my view and device in dwgdirect
class afx_class_export cdwgvectorizedeviceublic odgsbasevectorizedevice,public odgigeometrysimplifier,public odrxdispatchimpl<>
{
protected:
odrx_using_heap_operators(odgsbasevectorizedevice) ;
...
};
class afx_class_export cdwgvectorizeviewublic odgsbasevectorizeview
{
protected:
...
};
class afx_class_export cdwgfilerotected oddbhostappservices,public oddbhostappprogressmeter
{
public:
...
};
when i open a dwg file,i need populates device object with view object,so
void cdwgfile::init()
{
pdwgcontext = odgicontextfordbdatabase::createobject();
m_pdevice = cdwgvectorizedevice::createobject();
pdwgcontext->setdatabase(pdatabase);
try
{
m_pdevice=oddbgsmanager::setupactivelayoutviews(m_ pdevice, pdwgcontext);
}
catch(oderror &e)
{
trace("%s\n",e.description());
}
((cdwgvectorizedevice*)(m_pdevice.get()))->setdwgfile(this);
}
in 1.12 and before version,everything is ok.
in 1.13,it crash in "m_pdevice=oddbgsmanager::setupactivelayoutviews(m _pdevice, pdwgcontext);"
what's the difference between 1.12 and 1.13 ? what's the code that must be checked ?
hi,
in 1.13 gs initialization is required. you should call odgsinitialize() before using any class implemented in dd_gs.dll(lib). and odgsuninitialize() after destroying all instances of gs classes.
problem also exist
i add odgsinitialize() and odgsuninitialize() to my code.
bool cdwgengine::init()
{
odinitialize(this);
odgsinitialize();
return true;
}
void cdwgengine:einit()
{
odgsuninitialize();
oduninitialize();
}
it aloso crash.
is there orther code that need to be checked ?
your implementation of cdwgvectorizedevice::createview() should call odgsviewimpl::init(), i guess, it does not.
you are right
you are right.
the problem is gone.
why it crash in 1.13,but not in 1.12 ?
another quest
i have another problem ,it bother me for a long time.
if i change layout to model,every entity is be draw,when i change to another layout,there is a big rect that cover anything,how to correct the problem ?
|