查看单个帖子
旧 2009-05-06, 09:16 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】odwriteex in borland builder6

odwriteex in borland builder6
odwriteex in borland builder6
i'm new to dwgdirect and am trying to learn about it. i need to create dwg/dxf files so i decided to compile and run the test app odwriteex. i have done this successfully ( as a console app ), unfortunately when i run the app it gives the following output
load completed------------------------
audit : ok.
error :invalid input
press return to exit...
the following line throws an exception -
pdb->writefile(&fb, filetype, outver, true /* save preview */);
the error string associated with the exception is "invalid input".
any help would be appreciated.
(my compiler is borland c++ builder 6 , running on xp sp2)
i've found the answer in the dwgdirect reference faq
replace :
pdb->writefile(&fb, filetype, outver, true /* save preview */);
with:
if (filetype==oddb::kdxf)
{
pdb->writefile(&fb, oddb::kdxf, oddb::vac18, true /* save preview */);
}
else
{
pdb->writefile(&fb, oddb::kdwg, oddb::vac18, true /* save preview */);
};
note that the outver variable cause a problem as well as the filetype.
if anyone is interested...
the borland compiler has an option "treat enum types as ints" which is unset by default. if you set this option then if fixes the problem described in this thread. it's probably a good idea to set it when compiling any of the example projects in borland builder?
dwgdirect uses the default setting for this option, and according to the borland docs if you don't specify anything it is equivalent to -b (treat enums as ints). dwgdirect client applications should use this same setting, and avoid the use of -b- which forces enums to bytes when possible.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)