CFileDialog question
-
I am using
CFileDialog
to select multiple files. When I select single file, the member functionGetPathName()
. But when multiple files are selected the folder path is returned. How do I get the path of all the files that are selected.:rose:
-
I am using
CFileDialog
to select multiple files. When I select single file, the member functionGetPathName()
. But when multiple files are selected the folder path is returned. How do I get the path of all the files that are selected.:rose:
Did you not read the documentation? It plainly states that: If
m_ofn.Flags
has theOFN_ALLOWMULTISELECT
flag set, you should callGetStartPosition()
andGetNextPathName()
to retrieve a file pathname.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
I am using
CFileDialog
to select multiple files. When I select single file, the member functionGetPathName()
. But when multiple files are selected the folder path is returned. How do I get the path of all the files that are selected.:rose:
Use this loop ,
POSITION pos = dlg.GetStartPosition(); while (pos != NULL) { CString sFileName = dlg.GetNextPathName(pos); }
-- modified at 10:05 Friday 6th October, 2006
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Use this loop ,
POSITION pos = dlg.GetStartPosition(); while (pos != NULL) { CString sFileName = dlg.GetNextPathName(pos); }
-- modified at 10:05 Friday 6th October, 2006
Prasad Notifier using ATL | Operator new[],delete[][^]
Thank you very much.
:rose:
-
Did you not read the documentation? It plainly states that: If
m_ofn.Flags
has theOFN_ALLOWMULTISELECT
flag set, you should callGetStartPosition()
andGetNextPathName()
to retrieve a file pathname.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.
:rose:
-
Use this loop ,
POSITION pos = dlg.GetStartPosition(); while (pos != NULL) { CString sFileName = dlg.GetNextPathName(pos); }
-- modified at 10:05 Friday 6th October, 2006
Prasad Notifier using ATL | Operator new[],delete[][^]
I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.
:rose:
-
I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.
:rose:
Just ignore the voting system. It's so easily abused, the numbers mean nothing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.
:rose:
As said by David , just ignore it.:)
Prasad Notifier using ATL | Operator new[],delete[][^]