I created a subclass of CFileDialog that takes a dialog caption and a caption for the "Open" or "Save" button in addition to the usual parameters to the constructor. This works fine for an open file dialog, but when I use it with a save file dialog, the caption on the "Save" button does not change. Why? The code is as follows:

CMyFileDialog::CMyFileDialog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt,
LPCTSTR lpszFileName, DWORD dwFlags,
LPCTSTR lpszFilter, CWnd* pParentWnd,
const char* strTitle, const char* strBtnCaption
) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter,
pParentWnd
)
{
m_csTitle = strTitle;
m_ofn.lpstrTitle = m_csTitle;
m_csBtnCaption = strBtnCaption;
}

BOOL CMyFileDialog::OnInitDialog()
{
CFileDialog::OnInitDialog();

GetParent()->SetDlgItemText(IDOK, m_csBtnCaption);

return TRUE;
}