几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 03:11 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how to save file with thumbnailimage included

how to save file with thumbnailimage included?
how to save file with thumbnailimage included?
i save the dwg file by using writefile(fname,ftype,fversion,true), but the saved file does not contain a thumbnailimage which is in the origional one. what's the wrong?
quote:
originally posted by ideeinfo
i save the dwg file by using writefile(fname,ftype,fversion,true), but the saved file does not contain a thumbnailimage which is in the origional one. what's the wrong?
hi,
which file version (fversion) do you use? dwg version > r12 and dxf > r14 may content thumbnailimage.
that version of dwg direct do you use?
best regards,
sergey z.
the dwg version is 2006 and the dwgdirect is 1.14.02. i compare the saved file with the original one, and find that the file size is decreased about 30~40kb after it is saved. the file explorer will show the thumbnailimage when i pick the oroginal one.
last edited by ideeinfo; 24th july 2006 at 05:05 pmfff">.
hi,
check your implementation oddbhostappservices. it must contents implementation "odgsdeviceptr gsbitmapdevice()" method. you may use winbitmap.gs module from dwgdirect extensions. for example see odwriteex project.
best regards,
sergey z.
by checking, i find that i use the same files exhostappservices.cpp and exsystemservices.cpp as that in the sample project odwriteex. then i add the file exgirasterimage.cpp to my project. but the results show no change has happened.
quote:
originally posted by ideeinfo
by checking, i find that i use the same files exhostappservices.cpp and exsystemservices.cpp as that in the sample project odwriteex. then i add the file exgirasterimage.cpp to my project. but the results show no change has happened.
your implementation must have "odgsdeviceptr gsbitmapdevice()". exsystemservices doen't have it.
try to use next code ( from odwriteex.cpp):
code:
class myservices : public exsystemservices, public exhostappservices
{
protected:
odrx_using_heap_operators(exsystemservices);
odgsdeviceptr gsbitmapdevice()
{
try
{
odgsmoduleptr pgsmodule = :drxdynamiclinker()->loadmodule(dd_t("winbitmap.gs"));
return pgsmodule->createbitmapdevice();
}
catch(const oderror&)
{
}
return odgsdeviceptr();
}
};
#if !defined(_toolkit_in_dll_) || defined(__mwerks__)
odrx_declare_static_module_entry_point(bitmapmodule);
odrx_begin_static_module_map()
odrx_define_static_appmodule (dd_t("winbitmap.gs"), bitmapmodule)
odrx_end_static_module_map()
#endif
...
odstaticrxobject<myservices> svcs;
...
odinitialize(&svcs);
best regards,
sergey z.
then when i add this code, there occur the compiling errors:
error c2143: syntax error : missing ';' before '('
error c2143: syntax error : missing ')' before ','
error c2501: 'this_file' : missing storage-class or type specifiers
error c2059: syntax error : 'constant'
point to the code line:
odrx_using_heap_operators(exsystemservices);
i don't know what's the reason.
after some efforts, i make it be passed through compling and linking. but at runtime there is also an exception at the code:
odgsmoduleptr pgsmodule = :drxdynamiclinker()->loadmodule(("winbitmap.gs"));
which lists the error information "cxx0030: error: expression cannot be evaluated" in debug mode. so the returned value of pgsmodule is null.
how can i do then.
note: in the above code the text "dd_t" can not be used, otherwise an error of "undefined identifier" will be caused at compiling phase.
dear sergey z.
ok, i have finally got it resolved.
thank you.
quote:
originally posted by ideeinfo
dear sergey z.
ok, i have finally got it resolved.
thank you.
it is very good. i am sorry about dd_t() ( i have got code from unicode project).
best regards,
sergey z.
could you help me resolve it to please? i can't work out what libraries or headers to include for this function gsbitmapdevice to compile.
i added a #include <gs.h> and thought i resolved it. in release mode it built with no errors. but when i ran the application the resulting dwg was 0 bytes.
so i then tried debug mode and it would not compile:
exgswin32device.obj : error lnk2001: unresolved external symbol "public: __thiscall odcommondeviceprops:dcommondeviceprops(void)" (??0odcommondeviceprops@@qae@xz)
exgswin32device.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall odcommondeviceprops::generatepropmap(class odrxdictionary *)const " (?generatepropmap@odcommondeviceprops@@ubexpavodrx dictionary@@@z)
exgswin32device.obj : error lnk2001: unresolved external symbol "public: virtual __thiscall odcommondeviceprops::~odcommondeviceprops(void)" (??1odcommondeviceprops@@uae@xz)
ok, i got further, but i have what appears to be two unrelated problems. firstly, i removed all the exgswin32device etc files from my application because i could not see them included in the odamfcapp example project.
next, after reading this message thread properly, i added this code at the top of my cpp file:
#ifndef _toolkit_in_dll_
odrx_declare_static_module_entry_point(bitmapmodul e);
odrx_begin_static_module_map()
odrx_define_static_appmodule (dd_t("winbitmap.gs"), bitmapmodule)
odrx_end_static_module_map()
#endif
next, i added a #include:
#include <rxdynamicmodule.h>
i made my gsbitmapdevice look like this:
odgsdeviceptr cseq2dwgapp::gsbitmapdevice()
{
try
{
odgsmoduleptr pgsmodule = :drxdynamiclinker()->loadmodule(dd_t("winbitmap.gs"));
return pgsmodule->createbitmapdevice();
}
catch(const oderror&)
{
}
return odgsdeviceptr();
}
i added gs_winbitmap.lib to my library list and now the project compiles. but i get no bitmap preview. when i debug, the pointer returned is null. what steps have i missed? i have an unrelated problem which i will discuss in another thread. but i would appreciate a little guidance here from anyone who has the time. thank you.
i did another hunt in the forum and noticed a comment about using:
odrx_init_static_module_map();
in initinstance. this is the thing with sample applications. they are so huge, you miss what you actually need for simpler applications. but hooray for the support forum
now i have a valid pointer, but i get an error when the bitmap is being created which shows in a message box:
"object of class odgirasterimage can't be cast to odrasterconvertpe"
ideas?
bingo! a seperate thread showed the answer. so now my code is:
#ifndef _toolkit_in_dll_
odrx_declare_static_module_entry_point(bitmapmodul e);
odrx_declare_static_module_entry_point(odrasterpro cessingservicesimpl);
odrx_begin_static_module_map()
odrx_define_static_appmodule (dd_t("winbitmap.gs"), bitmapmodule)
odrx_define_static_application(dd_t("rasterprocess or"), odrasterprocessingservicesimpl)
odrx_end_static_module_map()
#endif
and i included dd_vc6mt_rxrasterprocessor.lib and now i have bitmap previews.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】hatching entities yang686526 DirectDWG 0 2009-05-05 12:01 PM
【转帖】different vectorization of same file on windows and mac yang686526 DirectDWG 0 2009-05-04 07:29 PM
【转帖】creating a sat file out of dxf solid file yang686526 DirectDWG 0 2009-05-04 06:47 PM
【转帖】auto create 11 flat pattern and save as dxf yang686526 SolidWorks二次开发 0 2009-04-13 09:08 AM
【转帖】how to save to dxf in active drawing file location yang686526 SolidWorks二次开发 0 2009-04-12 09:23 PM


所有的时间均为北京时间。 现在的时间是 11:05 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多