高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】help with borland c== expor
help with borland c++ export...
help with borland c++ export...
hello,
our company is evaluating the dwgdirect libraries for use in our applications. i am trying to get an example going in borland cbuilder 6, but running into problems. all we need to do is create a new dwg/dxf file, create objects, add them to the db, and write the file out. using the mfc example provided as a guide, i copied the myservices class and dbfiller class, but only created one circle object in the modelspace on the filldatabase method (i kept getting file errors with the addstyles of "verdana.ttf", "txt", and "ltypeshp.shx"). i create button click event code like:
{
odstaticrxobject<myservices> svcs;
odinitialize( &svcs );
oddbdatabaseptr db = svcs.createdatabase();
svcs.disableoutput(true);
dbfiller filler;
filler.filldatabase( db );
odwrfilebuf buf( "c:\\text.dxf" );
db->writefile( &buf, oddb::kdxf, oddb::vac13 );
oduninitialize();
}
it is creating the file with the one object in it, however it throws an exception on the oduninitialize(); (in one of the release calls).
any suggestions?
are there borland cbuilder 6 examples available?
thank you,
nuzzi
by the moment you call oduninitialize() all smart pointers must go out of scope or be zeroed. that will allow to destroy object they are pointing to.
in your case oduninitialize() is called before database is destroyed oddbdatabaseptr db holds it.
we have bb6 project file for odwriteex sample which is cross-platform.
sergey slezkin
thank you...
thanks sergey, setting the db to null prior to odunitialize did the trick. now, is there going to be v7 support in the dgn library soon?
thanks again,
nuzzi
i'm not involved into dgn project. where is a separate forum for dgndirect related questions.
sergey slezkin
|