几何尺寸与公差论坛------致力于产品几何量公差标准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:22 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how can i set filetype in odadlge

how can i set filetype in odadlgext ?
how can i set filetype in odadlgext ?
hi guys.
i want to access the setting about filetype extension in odadlgext.dll.
(such as set default to some filetype).but it seem have only 4 method.
could somebody suggest me the way to set selection filetype as i want?
thanks a lot
there is a source code for this dialog. tweak it as you wish.
source is at \extensions\win\extdialog\
vladimir
filedlgext.cpp
code:
bool dlgext_export createopenwithpreviewdlg(cabstractpreview *pview, hwnd hparent, lpctstr lpszfilename,
lpctstr lpszfilter, dword dwflags, openwithpreviewdlg **pdlg)
{
afx_manage_state(afxgetstaticmodulestate());
cwnd wparent;
*pdlg = null;

_savedhinstance = afxgetresourcehandle();
//wparent.attach(hparent);
try
{
//afxsetresourcehandle(_savedhinstance);
cpreviewfiledlg *pnew = new cpreviewfiledlg(pview, true, nullfff">, lpszfilename, dwflags, lpszfilter);
*pdlg = static_cast<openwithpreviewdlg *>(pnew);
}
catch (...)
{
return false;
}
return true;
}
red nullfff"> is pointer to default extension.
sergey slezkin
thanks a lot slezkin.
i try to put some path file(cstring) in red position that you have suggested.
it just show only file type in "file name" in combo box.
but i need to set the selecting of "files of type" to any index file types as i want.
for example in this attached picture if i want to select "web source.."
how can i apply the code?
attached images (26.1 kb, 7 views)

sorry, my previous post was incorrect.
but:
extdialog is available with sources.
cpreviewfiledlg is derived from mfc cfiledialog.
from cfiledialog constructor description:
the lpszfilter parameter is used to determine the type of filename a file must have to be displayed in the file list box. the first string in the string pair describes the filter; the second string indicates the file extension to use. multiple extensions may be specified using ??as the delimiter. the string ends with two 憒?characters, followed by a null character. you can also use a cstring object for this parameter.
but note that cpreviewfiledlg is able to show preview only from dwg and dxf not from "web resources" :-)
sergey slezkin
hi slezkin...
maybe that was my fault. i didn't make my question clearly.
caz,my point is to keep some registry value of the file that i had ever opened in lastest time.
so when i'll open next time,i don't have to select file type list again.
for example, my method to set index of file type in easy cfiledialog.
please see the code as the follow.
code:
cfiledialog dlg(true, 0, 0, ofn_hidereadonly | ofn_overwriteprompt,
_t("dwg files(*.dwg)|*.dwg|dxf files(*.dxf)|*.dxf||"));
dlg.m_ofn.nfilterindex = 2 ;
so.. i got index type of file to opening in dxf format.
then i can keep that to registry and bra bra...
the question is.. how can i apply these method to cpreviewfiledlg?
caz i'm not sure that i can access to variable "m_ofn" or not.
and if i can't.
can you make some patch to use anyfunction to set that with out changing
cstring in lpszfilter? caz i want to keep ordering the file type.
in case if there are more file types. thanks
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】length width macro yang686526 SolidWorks二次开发 0 2009-04-12 09:33 PM
【转帖】inserting and mating parts in an assembly yang686526 SolidWorks二次开发 0 2009-04-12 09:28 PM
【转帖】fixed par yang686526 SolidWorks二次开发 0 2009-04-12 08:55 PM
【转帖】batch printing as pdfs from a list bo yang686526 SolidWorks二次开发 0 2009-04-12 08:16 PM
【转帖】inserting and mating parts in an assembly yang686526 SolidWorks二次开发 0 2009-04-12 06:43 PM


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


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