查看单个帖子
旧 2009-05-05, 08:38 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】dwgdirect rendering crash

dwgdirect rendering crash

dwgdirect rendering crash
hi,
i'm having problem in rendering.
when i call update function of wingdi.gs device i get a crash.
i think i'm missing something in device initialization.
here is my code:
code:
// --------------------------------------------------------------
// initdwglayer
// --------------------------------------------------------------
void
cdwglayer::initdwglayer()
{
mtypeid = layer_type_dwg;
// odrxobjectimpl<exsystemservices> msysserv;
odinitialize(&msysserv); // dwgdirect initialization
// odrxobjectimpl<exhostappservices> mhostappserv;
mdbptr = mhostappserv.createdatabase( true, oddb::kmetric );
#ifndef _toolkit_in_dll_
odrx_init_static_module_map();
#endif
initrenderdevice();
}
// --------------------------------------------------------------
// initializerenddevice
// --------------------------------------------------------------
void
cdwglayer::initrenderdevice()
{
cview* pview = ::getmasterlayer()->getview();
crect rc;
getclientrect(pview->getsafehwnd(),&rc);
odgsmoduleptr pgs = :drxdynamiclinker()->loadmodule("wingdi.gs", true);

if( pgs.isnull() )
return;
mdeviceptr = pgs->createdevice(); // odgsdeviceptr mdeviceptr;
if( mdeviceptr.isnull() )
return;
odrxdictionaryptr pproperties = mdeviceptr->properties();
pproperties->putat("windowhwnd", odrxvariantvalue( (long)(pview->getsafehwnd()) )); /**/
if(pproperties->has("doublebufferenabled")) // check if property is supported
pproperties->putat( "doublebufferenabled", odrxvariantvalue( true ) );

if(pproperties->has("windowhdc")) // check if property is supported
pproperties->putat("windowhdc", odrxvariantvalue( (long)(pview->getdc()) )); // hwindowdc necessary for bitmap device
if(pproperties->has("doublebufferenabled")) // check if property is supported
pproperties->putat( "doublebufferenabled", odrxvariantvalue( true ) );
odgsdcrect gsrect(rc.left, rc.right, rc.bottom, rc.top);
mdeviceptr->setbackgroundcolor( rgb(255,255,255) );
//mdeviceptr->setlogicalpalette(theapp.curpalette(), 256);
if( !mdbptr->database() ) // oddbdatabaseptr mdbptr;
return;
int n = mdeviceptr->numviews();
// odrxobjectimpl<odgicontextfordbdatabase> mgicontext;
mgicontext.setdatabase( mdbptr ); // contect <-> database association
// odgsdeviceptr mdeviceptr;
mdeviceptr = oddbgsmanager::setupactivelayoutviews( mdeviceptr, &mgicontext ); /**/

//mgicontext.setviewportborderproperties( mdeviceptr, true );
#ifdef automatically_zoom_toextents_when_openingdrawing
if(zoomextents)
viewzoomextents();
#endif
mgicontext.enablegsmodel(true); // caching enable
n = mdeviceptr->numviews();

mdeviceptr->onsize( gsrect );

draw();
}
what is wrong in it?
thank you
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============

myzhar
# 8th february 2006, 04:54 am

softdev join date: jun 2002
location: st'petersburg, russia
posts: 522

what kind of crash? exception?
is it oderror exception? if it is, what is error code?
sincerely yours,
george udov

george udov
# 8th february 2006, 04:56 am

registered user join date: feb 2006
location: pisa
posts: 69

quote:
this is the error:
unhandled exception at 0x0064dc99 in geoapp.exe: 0xc0000005: access violation reading location 0x00000000.
i noticed that the error is at the command:
geoapp.exe!oddbobjectidenobject() + 0x41
maybe my database is not correctly cofigured?
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
last edited by myzhar; 8th february 2006 at 09:08 amfff">.

myzhar

none
? | ?
thread tools



display modes
linear mode


search this thread

rate this thread
excellent
good
average
bad
terrible

posting rules
you may post new threads
you may post replies
you may post attachments
you may edit your posts
is on
are on
code is off
html code is off
forum jump
user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx)
all times are gmt -7. the time now is 11:35 pmfff">.
- - -
copyright ?2000 - 2009, jelsoft enterprises ltd.
copyright 1998-2008 open design alliance inc.

what kind of crash? exception?
is it oderror exception? if it is, what is error code?
sincerely yours,
george udov

quote:
this is the error:
unhandled exception at 0x0064dc99 in geoapp.exe: 0xc0000005: access violation reading location 0x00000000.
i noticed that the error is at the command:
geoapp.exe!oddbobjectidenobject() + 0x41
maybe my database is not correctly cofigured?
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
last edited by myzhar; 8th february 2006 at 09:08 amfff">.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)