CFileDialog SaveAs Question
-
Is there anyway to change the Save button text of the SaveAs dialog of the CFileDialog class to be something else? Thanks in advance, Bob
derive a class from CFileDialog. override OnInitDialog. then, do this:
GetParent()->GetDlgItem(IDOK)->SetWindowText("My new label");
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
derive a class from CFileDialog. override OnInitDialog. then, do this:
GetParent()->GetDlgItem(IDOK)->SetWindowText("My new label");
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917Chris, Thanks for your response. I tried as you suggested, but it crashes. If I do a
CFileDialog dlg(FALSE, "*.imp", NULL, NULL, szFilter); CWnd *wnd = dlg.GetDlgItem(IDOK);
it crashes on the dlg.GetDlgItem call. dlg.hWnd = 0. Perhaps I'm doing this in the wrong place? Thanks, Bob -
Chris, Thanks for your response. I tried as you suggested, but it crashes. If I do a
CFileDialog dlg(FALSE, "*.imp", NULL, NULL, szFilter); CWnd *wnd = dlg.GetDlgItem(IDOK);
it crashes on the dlg.GetDlgItem call. dlg.hWnd = 0. Perhaps I'm doing this in the wrong place? Thanks, Bobmoobob wrote: Perhaps I'm doing this in the wrong place? yup 1. derive a class from CFileDialog (you have to make a new class, not just instantiate a CFileDialog). ClassWizard can help with this. 2. override OnIntiDialog in that derived class (not in the class that uses the new CFileDialog) 3. put that line of code in the derived class's OnInitDialog -c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
moobob wrote: Perhaps I'm doing this in the wrong place? yup 1. derive a class from CFileDialog (you have to make a new class, not just instantiate a CFileDialog). ClassWizard can help with this. 2. override OnIntiDialog in that derived class (not in the class that uses the new CFileDialog) 3. put that line of code in the derived class's OnInitDialog -c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
derive a class from CFileDialog. override OnInitDialog. then, do this:
GetParent()->GetDlgItem(IDOK)->SetWindowText("My new label");
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917ur reply to the poster is very interesting. if GetParent() gets the dialog, what does m_hWnd of the new class stand for? thx includeh10
-
ur reply to the poster is very interesting. if GetParent() gets the dialog, what does m_hWnd of the new class stand for? thx includeh10
i don't know. that's just code i've always used without even looking at it. it works fine. -c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917