:

drxdynamiclinker()->loadmodule
:

drxdynamiclinker()->loadmodule
hallo
i am having a very strange problem using :drxdynamiclinker()->loadmodule when trying to load a graphics device (wingdi.gs). i have developed an activex using oda and while running inside vb6 i get exceptions when loading the module. here is part of my initinstance and exitinstance code.
initinstance()
:
:
:
sprintf(path,"%s%s",csystem::gen_path,gsdriver);
:dinitialize(this);
afxmessagebox("after :dinitialize");
:drxinitwinntcrypt();
afxmessagebox("after :drxinitwinntcrypt");
#if !defined(_toolkit_in_dll_) && defined(_acad2004_)
odrx_init_static_module_map();
#endif
m.format("before :drxdynamiclinker %s",path);
afxmessagebox(m);
m_pgs = :drxdynamiclinker()->loadmodule(path);
m.format("after :drxdynamiclinker %s",path);
afxmessagebox(m);
if (m_pgs.isnull())
{
cstring err_msg;
err_msg.format("unable to load %s",gsdriver);
afxmessagebox(err_msg);
return false;
}
}
catch (const oderror& e)
{
m.format("dwgdirect initialization error - %s", e.description());
afxmessagebox(m);
}
catch (...)
{
afxmessagebox("failed to init oda");
}
and
exitinstance
#if defined(_acad2004_)
sys_str path;
sprintf(path,"%s%s",csystem::gen_path,gsdriver); // default location for .gs drivers
m_pgs.release();
:drxuninitwinntcrypt();
:duninitialize();
#endif
(this is partial code).
what happens is that the application runs, i break the code (using ctrl-break in vb), restart the application and the loadmodule line then gives an exception - failed to init oda (oderror catch is never called!!). am i releasing the module correctly.
please help!
anton heymann
if you set breakpoint in catch(...) block, what is the call stack?
vladimir
loadmodule - wingdi.gs
vladimir
i believe the problem is related to the fact that i need to create 2 instances of the rendering surfaces. i have a main window in my application that display the drawing, but then also a 'zoom window' showing the extents of the current layout. i have implemented various 'resetdevice' functions (as per odamfcapp) to display the various views and my derived classes. i did however only load wingdi.gs (or whatever gs is specified) once at start-up in my application. is this correct? i am stuck at the moment and have worked around the problem by disabling the display in the 'zoom window'.
feedback will be appreciated.
anton heymann
drawing the database in 2 windows by different threads is not supported. if you are drawing zoom window first, and then the main window, then it may work, but perhaps you should regen cache in the main window for correct display.
gs device is loaded once anyway.
vladimir