I have subclassed CFileDialog.
I need to select both file and folder on certain case only.
Suppose I have a folder selected and it is containing desired file type.
Then in such situation, On clicking open button will not open the selected folder. But just close the CFileDialog with IDOK.
For doing this I need to provide my own implementation for Open button handler. I am not getting how I can do this.
Any suggestion or advice will be greatly appreciated!
Re: Overriding the Open button handler of CFileDialog
sorry or unclear information.
I have added "Select All" button on CFileDialog, which select all images file and subfolder containing images on clicking it. So currently I have both files and folder selected. So on clicking the open, opens one of the selected subfolder.
Here I just want to close the CFileDialog wih IDOK.
You should be careful with the solution proposed in this link.
I've had problems before on Windows 7 with a class derived from CFileDialog that called GetParent() in some overridden function. I can't recall exactly, but the problem was that GetParent() returned NULL. The fix was to store the parent's HWND as a member variable in OnInitDialog and then later use the member variable instead of calling GetParent().
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky