2 CFileDialogs
-
Hi all, I do: CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "Dialog Title"; Now i need a CFileDialog that shows only .txt files. I also need another CFileDialog which i use to save a file in which the "file type" field is .txt How can i do that ? Thanx in advance, Desmo16.
-
Hi all, I do: CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "Dialog Title"; Now i need a CFileDialog that shows only .txt files. I also need another CFileDialog which i use to save a file in which the "file type" field is .txt How can i do that ? Thanx in advance, Desmo16.
Look up how to construct Filters for the common file dialog. The docs for
CFileDialog
is a good place to start. Peace!-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites (Please rate this post!) -
Hi all, I do: CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "Dialog Title"; Now i need a CFileDialog that shows only .txt files. I also need another CFileDialog which i use to save a file in which the "file type" field is .txt How can i do that ? Thanx in advance, Desmo16.
set the extensions filter to
"Text files (*.txt)|*.txt||"
You don't know where to start ? ask a good friend
-
set the extensions filter to
"Text files (*.txt)|*.txt||"
You don't know where to start ? ask a good friend
i tried with CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "load file"; fd.m_pOFN->lpstrDefExt = "txt"; and also with CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "load file"; fd.SetDefExt("txt"); but it doesn't work. Where should i search in the doc exactly ?
-
i tried with CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "load file"; fd.m_pOFN->lpstrDefExt = "txt"; and also with CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "load file"; fd.SetDefExt("txt"); but it doesn't work. Where should i search in the doc exactly ?
not what i told you to do. i said assign the string
"Text files (*.txt)|*.txt||"
into the filter member of the CFileDialog... (see the 5th parameter of the constructor)
You don't know where to start ? ask a good friend
-
not what i told you to do. i said assign the string
"Text files (*.txt)|*.txt||"
into the filter member of the CFileDialog... (see the 5th parameter of the constructor)
You don't know where to start ? ask a good friend
-
You are right, now i wrote: CFileDialog fd(TRUE, NULL, "*.txt", OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); fd.m_pOFN->lpstrTitle = "Carica file di osservazioni"; fd.m_pOFN->lpstrFilter = "Text files (*.txt)"; and it works great ! Thanx !
yes, i modified my previous post ; you could also have done this using the 5th parameter of the constructor... also, don't hesitate to read the MSDN[^]. it's there for you !
You don't know where to start ? ask a good friend
-
yes, i modified my previous post ; you could also have done this using the 5th parameter of the constructor... also, don't hesitate to read the MSDN[^]. it's there for you !
You don't know where to start ? ask a good friend