linker problem with borland c++ builder 6...
linker problem with borland c++ builder 6...
hello all,
i get the following linker error when trying to build a test example:
"unresolved external odrxcreatemoduleobject_for_windgimodule(const odstring&) referenced from...."
did anybody experience this in their travels, and, if so, how did you go about resolving it?
thanks,
nuz
gs_wingdi.lib is missing
vladimir
thanks for the quick reply...
i figured that could have been the problem. i included it and got stuff about the coff omf records being different (borland vs. microsoft .lib files). so i used borland's coff2omf utility, but it created a very small file that did not seem to do the trick.
nuz
you mean - gs_wingdi.lib appeared to have been created by ms linker? (archiver, actually)
vladimir
i got that particular issue hammered out by simply building a .lib file in bcb with the source files used for the vc project, but still cannot make my test project work. i am simply trying to make a test example to draw a dxf chart to a canvas in borland c++ builder 6. the .lib file i create is about half the size of the one included for vc, but it fixes the unresolved external error. however, the following line of code:
odgsmoduleptr p_gs = odrxdynamiclinker()->loadmodule("wingdi.gs");
still return p_gs as null. i have registered all the module:
odrx_declare_static_module_entry_point(wingdimodul e);
?br /> odrx_begin_static_module_map()
?br /> odrx_define_static_appmodule(l"wingdi.gs", wingdimodule)
?br />
#ifndef _toolkit_in_dll_
odrx_init_static_module_map();
#endif
?br />
does anybody have a working sample for borland c++ builder 6.0 using wingdi?
thanks again,
nuz
fixed it. thanks. now it's throwing an exception at setupactivelayoutviews, but i'm sure i'll hammer that out eventually also. this is not an easy library to work with for sure. i think the documentation could be more thorough.
thanks,
nuz
i haven't been able to figure it out...
hello all,
the following line:
p_dev = oddbgsmanager::setupactivelayoutviews( p_dev, p_gi );
throws an exception. both p_dev and p_gi are not null and appear to be valid. any thoughts?
thanks,
nuz
what kind of exception? oderror? it's code, description?
sergey slezkin
hello again, sergey...
the error is an access violation (eaccessviolation at 0000000).
here is some code in a draw_chart function. the p_db is declared on the class constructor.
if (( p_db == null ) || ( h_wnd == null ) || !width || !height ) return;
w = width;
h = height;
odgsinitialize();
odgsmoduleptr p_gs = odrxdynamiclinker()->loadmodule("wingdi.gs");
if( p_gs.isnull()) return;
odgsdeviceptr p_dev = p_gs->createdevice();
if( p_dev.isnull()) return;
odrxdictionaryptr p_props = p_dev->properties();
p_props->putat( "windowhwnd", odrxvariantvalue(( long )h_wnd ));
p_dev = oddbgsmanager::setupactivelayoutviews( p_dev, p_gi );
odgsdcrect screen_rect( odgsdcpoint( 0, 0 ), odgsdcpoint( w, h ));
p_dev->onsize( screen_rect );
odgsuninitialize();
//p_dev->update();
nuz
i assume odinitialize() was called.
was database set to p_gi?
btw, you can consult with odvectorize sample.
sergey slezkin
hi sergey,
yes, odinitialize is being called in the constructor. here is the rest of the code:
c_od_dwg::c_od_dwg()
{
#ifndef _toolkit_in_dll_
odrx_init_static_module_map();
#endif
p_db = null;
w = h = 0;
odinitialize( &p_svcs );
}
c_od_dwg::~c_od_dwg()
{
p_db = null;
oduninitialize();
}
bool c_od_dwg::load_chart( char *fn )
{
try
{
p_db = p_svcs.readfile( fn, false, false, oda::ksharedenyno );
}
catch ( const oderror& ex )
{
p_db = null;
return false;
}
p_gi = odgicontextfordbdatabase::createobject();
p_gi->setdatabase( p_db );
p_gi->enablegsmodel( true );
return true;
}
what has to happen for setactiveview to bellyache like that? it's obviously something bad going in. would it do that with a bad hwnd, or missing hdc? where are the properties defined in the documentation so we know exactly what the device needs?
thanks again...
nuz
last edited by
nuzzi@hypack.com; 11th september 2007 at 11:43 amfff">.