MFC中的自定义CFileDialog [英] Customised CFileDialog in MFC

查看:386
本文介绍了MFC中的自定义CFileDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MFC应用程序(来自VC6)中,出于自定义目的,我有一个来自CFileDialog的类.我在OnInitDialog中添加了几个复选框,并且所有使用的命令都可以正常使用-在XP上.

现在,在Win7上的VS2010中进行编译,此方法不再起作用,我想我需要使用IFileDialogCustomize等.

(我仍然需要支持WinXP,因此我需要进行某种运行时检查,以查看要使用哪种自定义方法.)

但是,即使我包含< shobjidl.h> ;,我似乎也无法定义IFileDialogCustomize.与我的WIN_VER定义(0x0502)有关吗?如何使用IFileDialogCustomize并仍支持XP?


我得到它来编译并在Win7上工作-原来是我对NTDDI_VERSION(0x05010300-WinXPSP3)的定义.但是,这不应该定义最低操作系统吗?因此问题仍然存在,在Windows XP及更高版本上支持CFileDialog自定义的正确"方法是什么??

In my MFC app (from VC6) I have a class dervied from CFileDialog for the purposes of customisation. I add a couple of check boxes in OnInitDialog and everything USED to work OK - on XP.

Now, compiling in VS2010 on Win7, this method no longer works and I guess I need to use IFileDialogCustomize and the like.

(I still need to support WinXP, so I''ll need to do some sort of runtime check to see which customisation method to use).

However, I can''t seem to get IFileDialogCustomize to be defined, even if I include <shobjidl.h>. Is it to do with my WIN_VER definition (0x0502)? How do I use IFileDialogCustomize and still support XP?


I got it to compile and work on Win7 - turned out to be my definition of NTDDI_VERSION (0x05010300 - WinXPSP3). But isn''t that supposed to deinfe the minimum operating system? So the question remains, what is the ''proper'' way to support CFileDialog customisation on Windows XP AND above...?

推荐答案

Arrgh!事实证明它还没有坏!除了在XP下,自定义CFileDialog会自动调整Dlg的大小,而Vista +不会.我的复选框在那里,我只需要手动将对话框放大,以便可以看到它们.
Arrgh! Turns out it wasn''t broken after all! Except that under XP, customising CFileDialog automatically resizes the Dlg, and Vista+ doesn''t. My check boxes were there, I just had to manually make the dialog bigger so I could see them.


这篇关于MFC中的自定义CFileDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆