几何尺寸与公差论坛------致力于产品几何量公差标准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-05, 12:34 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how the file open preview code works

how the file open preview code works
how the file open preview code works
hi know that the 1.09 version contains a file open preview dll file and some other stuff. i also know it is coded in the example mfc app class in the onfileopen method.
but i don't just like block-copying code from one app into another. can someone actually take me through the steps of using the dll etc provided by opendwg and using in in my own program and the reasons for each functions call.
i would appreciate this.
previously, i just overrode cfiledialog and added function calls into that class to display a bitmap preview. but i do not know how to modify that to work with c++ libraries and it makes sense to use the ones supplied by opendwg.
thanks in advance.
andrew
hi - short of cutting and pasting the entire project in here ... the class of interest for you to study is
class cpreviewdib : public cabstractpreview
{
public:
void setpreviewfile(lpctstr lpfilename);
void drawpreview(hdc dc, int x, int y, int width, int height);
crect calc(int bmpwid,int bmpdep,int wndwid,int wnddep);
odthumbnailimage m_odimage;
};
you will also find that the odamdiapp utilizes a dll odafiledlgext.dll who's source code is found in the examples\win folder. this dll contains the class which is derived from cfiledialog.
class cpreviewfiledlg : public cfiledialog, public openwithpreviewdlg
{
declare_dynamic(cpreviewfiledlg)
public:
cpreviewfiledlg(cabstractpreview *ppreview,
...
how does one automatically use the dll in their project? or must i manually copy it into my project....
quote:
you will also find that the odamdiapp utilizes a dll odafiledlgext.dll who's source code is found in the examples\win folder. this dll contains the class which is derived from cfiledialog.
this dll is not in the dwgdirect folder on my pc....
how do i build the source...
open the project
examples\win\extdialog\filedlgext.dsw
this will generate the output dll.
that file does not exist in my 1.09 download....
the dsp file should be there.
i thought of that. i have done a filefind for all dsp and dsw files in all the downloaded 1.09 folders and i can't find one for the dialogue. can you please verify the integrity of the zip files on the server. if it is there, then i will re-downloaded.
thanks.
andrew
attached is the make configuration for this.
attached files (1.8 kb, 11 views)

the zip file contains dsp / dsw files. i put these in the example directory and try to compile and i get this error:
--------------------configuration: filedlgext - win32 releasemt--------------------
creating type library...
processing c:\dwgdirect\examples\win\extdialog\filedlgext.odl
filedlgext.odl
fatal error c1083: cannot open source file: 'c:\dwgdirect\examples\win\extdialog\filedlgext.od l': no such file or directory
midl : command line error midl1003 : error returned by the c preprocessor (2)
error executing midl.exe.
odadlgext.dll - 2 error(s), 0 warning(s)
can you just provide me the dll so that i can just use it with your sample code provided?
thanks.
andrew
ps. i am away for a week so will reply a week monday should you send me the dll file.
ok - we'll try again with the entire project.
attached files (9.6 kb, 12 views)

i managed to compile this project. i now have 3 dll files. one for release, debug and release mt.
which one should i use?
thanks.
andrew
quote:
originally posted by walt lounsbury
ok - we'll try again with the entire project.
i have good news and bad news.
good news:
got it to compile and got it to work in my own program.
bad news:
1. debug dll will not work with my debug build program (so i am using release dll).
2. it is not using the handle of the parent. it even doesn't work in the sample mfc app program. i can click each dialogue independantly.
can we please get point 2 rectified as soon as possible.
andrew
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】hatching entities yang686526 DirectDWG 0 2009-05-05 12:01 PM
【转帖】file open dialogue with bitmap preview yang686526 DirectDWG 0 2009-05-05 10:52 AM
【转帖】dwf forma yang686526 DirectDWG 0 2009-05-04 08:23 PM
【转帖】e cant open file yang686526 DirectDWG 0 2009-05-04 02:46 PM


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


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