高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|