Click here to Skip to main content
16,005,389 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 21:59
amitmistry_petlad 14-Feb-07 21:59 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 22:19
Roger Stoltz14-Feb-07 22:19 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 22:54
amitmistry_petlad 14-Feb-07 22:54 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 23:27
Roger Stoltz14-Feb-07 23:27 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 23:59
amitmistry_petlad 14-Feb-07 23:59 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz15-Feb-07 0:50
Roger Stoltz15-Feb-07 0:50 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 15-Feb-07 1:03
amitmistry_petlad 15-Feb-07 1:03 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz15-Feb-07 2:11
Roger Stoltz15-Feb-07 2:11 
I don't think I understand your question at all.

Have you understood that the data pointed to by ofn.lpstrFile is not really a string, but rather a multitude of strings seperated by a NULL character where the first is the folder path?

As an example:
Let's say you open the file dialog and browse to a directory "C:\MyDocs" and select three files, "File.txt", "File2.txt" and "File3.log". The data pointed to by ofn.lpstrFile will look like this "C:\MyDocs\0File1.txt\0File2.txt\0File3.log\0\0" which means that if you treat ofn.lpstrFile as a string it will only display "C:\MyDocs" and no file names since strings are "zero-terminated".

The while( *pFilename++ ); statement in my code increments the pFilename pointer until it reaches a "\0" and then increments the pointer once so that dereferencing the pointer will give the first character of the next filename. Or if you treat it as a string it will be the filename. If that character is "\0" as well, then the last selected filename has been handled and that's what the outer while-loop is checking for in my code.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 15-Feb-07 17:23
amitmistry_petlad 15-Feb-07 17:23 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 15-Feb-07 18:20
amitmistry_petlad 15-Feb-07 18:20 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz15-Feb-07 21:09
Roger Stoltz15-Feb-07 21:09 
QuestionRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
David Crow14-Feb-07 2:45
David Crow14-Feb-07 2:45 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Hamid_RT13-Feb-07 21:56
Hamid_RT13-Feb-07 21:56 
QuestionAbout Mfc??? Pin
siddharthsan13-Feb-07 19:24
siddharthsan13-Feb-07 19:24 
AnswerRe: About Mfc??? Pin
Cedric Moonen13-Feb-07 20:09
Cedric Moonen13-Feb-07 20:09 
AnswerRe: About Mfc??? [modified] Pin
toxcct13-Feb-07 22:11
toxcct13-Feb-07 22:11 
GeneralRe: About Mfc??? Pin
David Crow14-Feb-07 2:53
David Crow14-Feb-07 2:53 
GeneralRe: About Mfc??? Pin
toxcct14-Feb-07 2:54
toxcct14-Feb-07 2:54 
AnswerRe: About Mfc??? Pin
Hamid_RT14-Feb-07 7:07
Hamid_RT14-Feb-07 7:07 
QuestionA tab control with a Close (x) button for each Tab ? Pin
erajsri13-Feb-07 18:33
erajsri13-Feb-07 18:33 
AnswerRe: A tab control with a Close (x) button for each Tab ? Pin
Nibu babu thomas13-Feb-07 18:59
Nibu babu thomas13-Feb-07 18:59 
AnswerRe: A tab control with a Close (x) button for each Tab ? [modified] Pin
Naveen13-Feb-07 18:59
Naveen13-Feb-07 18:59 
GeneralRe: A tab control with a Close (x) button for each Tab ? Pin
erajsri13-Feb-07 19:23
erajsri13-Feb-07 19:23 
GeneralRe: A tab control with a Close (x) button for each Tab ? Pin
Naveen13-Feb-07 19:33
Naveen13-Feb-07 19:33 
GeneralRe: A tab control with a Close (x) button for each Tab ? Pin
erajsri13-Feb-07 23:16
erajsri13-Feb-07 23:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.