CFileDialog using MFC on Vista |
Post Reply |
Author | |
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
Posted: 08 May 2008 at 2:59am |
When using VS2008 and MFC I automatically get the Vista look on my file open dialogs. But when I have added a template this is not included :-(
I can then retrieve the GetIFileDialogCustomize interface and add controls. And this also works for me.
Thanks, cpede |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
I would really appreciate if someone knows answers to these problems
The positioning is only cosmetic, but the control events are important. Browsing the web only reveals that I should make a class derived from IFileDialogControlEvents abd use the Advise method, but since VS2008 MFC CFileDialog already does that, there must be an easier way??
-cpede
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
The new file dialog is one of the reasons why I switched back to XP
|
|
PokerMemento - http://www.pokermemento.com/
|
|
Sven
Senior Member Joined: 21 August 2003 Location: Germany Status: Offline Points: 127 |
Post Options
Thanks(0)
|
Set the last parameter in CFileDialogs constructor to FALSE and you will get the XP implementation on Vista too.
|
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
Well I was actually looking for a solution. Going back to old technology is not my style, I would rather solve the issues in front of me, - too early for me to resign.
Am I the only one making a custom CFileDialog? Looking in MSDN did not solve anything, and they are also terrible in answering posts at there forum.
-cpede
|
|
robin_l
Senior Member Joined: 15 October 2006 Status: Offline Points: 117 |
Post Options
Thanks(0)
|
Look at the IFileDialogControlEvents interface for handling button clicks etc. I'm not sure how you change from the default control size though.... |
|
Product: Xtreme ToolkitPro 2009 (13.4.1)
Platform: Windows 7 Ultimate(64bit) Language: Visual Studio 2010 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
Thanks for the reply.
I know that this is the interface to look for, and what I should do is to implement this interface and Advise the IFileDialog with this event connection point.
But when using CFileDialog in MFC 9 this already implements this interface, but by looking in the MFC code this implementation is empty.
My question is really can I redirect this interface to my own implementation?
Or is it possible to do a simple virtual inheritance?
What happens if I advice with my own, where does it leave the MFC implementation?
-cpede
|
|
robin_l
Senior Member Joined: 15 October 2006 Status: Offline Points: 117 |
Post Options
Thanks(0)
|
It is a while since I did this, but what I do is the following. In a class derived from CFileDialog, I include the following in the declaration:
BEGIN_INTERFACE_MAP(CMyDialog, CFileDialog) in the constructor you need to include USE_INTERFACE_PART_STD(FileDialogControlEvents);
STDMETHODIMP CMyDialog::XFileDialogControlEvents::OnItemSelected( IFileDialogCustomize *pfdc, DWORD dwIDCtl, DWORD dwIDItem )
STDMETHODIMP CMyDialog::XFileDialogControlEvents::OnCheckButtonToggled( IFileDialogCustomize *pfdc, DWORD dwIDCtl, BOOL bChecked ) STDMETHODIMP CMyDialog::XFileDialogControlEvents::OnControlActivating( IFileDialogCustomize *pfdc, DWORD dwIDCtl ) STDMETHODIMP_(ULONG) CMyDialog::XFileDialogControlEvents::AddRef() STDMETHODIMP_(ULONG) CMyDialog::XFileDialogControlEvents::Release() STDMETHODIMP CMyDialog::XFileDialogControlEvents::QueryInterface( |
|
Product: Xtreme ToolkitPro 2009 (13.4.1)
Platform: Windows 7 Ultimate(64bit) Language: Visual Studio 2010 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
Wow I really appreciate thanks
-cpede
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |