
CFileDialog Subclass Problem
I found the following question at Experts Exchange, which I hope someone has
a working solution to..
Quote:
> I have a class derived from CFileDialog. I have inserted a CComboBox at
the bottom of the dialog. In the added combo box are a list of previously
used directories for saving reading.
What I want to do is when somebody selects a directory on the ComboBox this
will change the default directory in the CFileDialog to the one selected in
the ComboBox.
Accepted Solution:
I send another suggestion after that. But I can not see it. I do not know
what's wrong. I want to tell you that add this line in your program:
GetParent()->PostMessage( WM_NOTIFY, CDN_FOLDERCHANGE, 0);
Please try to see if it works. If the message can be receive by the window,
may be you do not need to fill the structure after you use
SetCurrentDirectory.
The problem is that the solution does not work. It Just Crashes! I don't
believe you can Post a WM_NOTIFY message in that manner.
I tried the following in my CFileDialogEx::OnComboBoxSelect() and it had no
effect.
CFileDialogEx::OnComboBoxSelect()
{
// ...Some code left out
// m_notify is defined as NMHDR notify and is a class member.
m_notify.hwndFrom = m_hWnd;
m_notify.idFrom = 0; // I tried the actual Ctrl ID here but it did not make
a difference
m_notify.code = CDN_FOLDERCHANGE;
GetParent()->PostMessage( WM_NOTIFY,0,(LPARAM)&m_notify);
// ...Some code left out
Quote:
}
Any Help is appreciated,
Thanks in Advance,
John M. Drescher
http://www.*-*-*.com/