Re: CFileDialog
"phil oakleaf" <news@oakleafsoftware.co.uk> ha scritto nel messaggio
news:OTFo$Nt1JHA.4412@TK2MSFTNGP06.phx.gbl...
I've installed VS-2008
Updated MFC to the latest version
To get the ApplyOFNToShellDialog methods visible I've had to change WINVER
from 0x0400 to 0X0600, which worries me.
Does this create compatability problems if the software is run on older
versions of Windows (we have some users on WIn95)
I may be wrong, but I think that if you want to support Win95, you can't use
VS2008.
IIRC, the latest VC++ compiler that supports building code for Win95 is
Visual Studio .NET 2003 (a.k.a. VC++7.1).
(I'm not sure if VS2005 supports Win95... I recall that VS2005 supports
Win98.)
Moreover, I think that if you want to use the new Vista dialog, your code
can't run on Win95.
Anyway, having done all this when I do the following
m_myFileDialogPtr->UpdateOFNFromShellDialog();
m_myFileDialogPtr->m_ofn.lpstrTitle = L"New Dialog Title";
m_myFileDialogPtr->ApplyOFNToShellDialog();
m_myFileDialogPtr->DoModal();
as soon as DoModal is called, I get an assert
f:\dd\vctools......\dlgfil.cpp" - a file I dont have
I have the file 'dlgfil.cpp' in this folder:
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc
I've tried this code on VS2008 and it works fine (you can build a
dialog-based app with MFC, and associate this code to the click of a button
on the dialog-box):
<code>
void CTest1Dlg::OnBnClickedButton1()
{
// Open file dialog
CFileDialog fileDlg(TRUE);
// Update the m_ofn variable
fileDlg.UpdateOFNFromShellDialog();
// Change the title
fileDlg.m_ofn.lpstrTitle = L"New Dialog Title";
// Apply the changes
fileDlg.ApplyOFNToShellDialog();
// Show the window
fileDlg.DoModal();
}
</code>
HTH,
Giovanni