![]() |
【转帖】createdevice crashing
createdevice crashing
createdevice crashing hello everyone, i am very new to these forums. i have been looking over them the last few days trying to write a very simple app that will load a dwg file and then display it to a .net picturebox. i have all the dependencies worked out now. the problem i am having is that when i call 'device = pgs->createdevice();' my program crashes. i have looked through serveral examples that came with the dd_nonlibs. that is actually where i got that code from. from the singedoc example. if anyone could offer some help on this i would be very grateful. code: system::void form1::button1_click(system::object * sender, system::eventargs * e) { odgsdeviceptr device; oddbdatabaseptr pdb; bool binitserv = false; oduint32 datalength = 0; odbinarydata* thumbnail; odrxobjectimpl<dwgservices> svcs; try { odinitialize(&svcs); binitserv = true; odgsmoduleptr pgs = ::odrxdynamiclinker()->loadmodule("wingdi.gs"); device = pgs->createdevice(); //pdb = svcs.readfile("c:\\data\\building.dwg"); //pdb.release(); } catch (oderror& e) { messagebox(null, "oderror", "oderror", mb_ok); } catch (...) { messagebox(null, "general error", "general error", mb_ok); } if(binitserv) oduninitialize(); } last edited by baldrin; 30th december 2005 at 08:09 amfff">. is pgs valid? i'd assume that it isn't loading the module as you expect. it wasn't valid. but i add the macros below and now it loads. #ifndef _toolkit_in_dll_ odrx_declare_static_module_entry_point(wingdimodul e); #ifdef enable_acis_support odrx_declare_static_module_entry_point(modelermodu le); #endif odrx_begin_static_module_map() odrx_define_static_appmodule("wingdi.gs", wingdimodule) #ifdef enable_acis_support odrx_define_static_application("modelergeometry", modelermodule) #endif odrx_end_static_module_map() #endif |
所有的时间均为北京时间。 现在的时间是 05:54 AM. |