Click here to Skip to main content
15,914,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Proverbial good example of CTreeCtrl Pin
David Crow5-Nov-10 4:03
David Crow5-Nov-10 4:03 
GeneralRe: Proverbial good example of CTreeCtrl Pin
CPallini5-Nov-10 4:12
mveCPallini5-Nov-10 4:12 
GeneralRe: Proverbial good example of CTreeCtrl Pin
Sauro Viti5-Nov-10 6:40
professionalSauro Viti5-Nov-10 6:40 
GeneralRe: Proverbial good example of CTreeCtrl Pin
David Crow5-Nov-10 4:00
David Crow5-Nov-10 4:00 
QuestionChanging initial directory on File Open Dialog in MFC Pin
Ed The C4-Nov-10 7:48
Ed The C4-Nov-10 7:48 
AnswerRe: Changing initial directory on File Open Dialog in MFC Pin
Code-o-mat4-Nov-10 8:12
Code-o-mat4-Nov-10 8:12 
AnswerRe: Changing initial directory on File Open Dialog in MFC Pin
«_Superman_»4-Nov-10 8:31
professional«_Superman_»4-Nov-10 8:31 
GeneralRe: Changing initial directory on File Open Dialog in MFC [modified] Pin
Ed The C5-Nov-10 6:20
Ed The C5-Nov-10 6:20 
Thanks, but what I have discovered is that if the Vista flag for the CFileDialog is set false, then the dialog will fail (not display and immediately return IDCANCEL) with a "bad filename" in the CommDlgExtendedError. It does not like just a directory in the lpstrFile if the Vista flag is false.

So unless there's another idea floating about, I am stuck! I have to use the old style dialog for now.

UPDATE(s): To help anyone who struggles with this:
I was not able (at first) to use the new style dialogs (vista=true) because OnInitDialog and OnInitDone are NOT supported anymore for CFileDialog. Our code did depend on this. But I found a post that suggested using OnFolderChange() instead. My tests indicate that it indeed is called before the user gets control (which was the reason for the OnInit stuff). So you might give that a try.

UPDATE2: The Superman's response is true, but I now know what the problem is: you have to have *.* or some more specific find option if you wish to set vista flag false and use lpstrFile. So, if I set the vista flag false, and use a string like "C:\\temp\\*.*" as lpstrFile, then the initial directory (C:\temp)is picked out of the full path.

Note that using the vista flag is cool as you get a preview, but in our case we have to do our own previews using a dialog template, which also is not supported after vista. So now, by using vista false, i get the OnInits, initial directory, and templates which means I can get my project done Smile | :)


Thanks for the help.

modified on Friday, November 5, 2010 3:55 PM

QuestionMessage Removed Pin
3-Nov-10 23:52
piul3-Nov-10 23:52 
AnswerRe: How to check if char* is a number Pin
CPallini4-Nov-10 0:03
mveCPallini4-Nov-10 0:03 
GeneralRe: How to check if char* is a number Pin
piul4-Nov-10 0:08
piul4-Nov-10 0:08 
GeneralRe: How to check if char* is a number Pin
Maximilien4-Nov-10 0:09
Maximilien4-Nov-10 0:09 
GeneralRe: How to check if char* is a number Pin
piul4-Nov-10 0:30
piul4-Nov-10 0:30 
QuestionRe: How to check if char* is a number Pin
CPallini4-Nov-10 0:51
mveCPallini4-Nov-10 0:51 
AnswerRe: How to check if char* is a number Pin
piul4-Nov-10 1:30
piul4-Nov-10 1:30 
AnswerRe: How to check if char* is a number [modified] Pin
Alain Rist4-Nov-10 1:44
Alain Rist4-Nov-10 1:44 
GeneralRe: How to check if char* is a number Pin
federico.strati4-Nov-10 0:11
federico.strati4-Nov-10 0:11 
QuestionQuery For CFileDialog? Pin
Le@rner3-Nov-10 20:43
Le@rner3-Nov-10 20:43 
AnswerRe: Query For CFileDialog? Pin
Maximilien3-Nov-10 21:30
Maximilien3-Nov-10 21:30 
AnswerRe: Query For CFileDialog? Pin
GAJERA3-Nov-10 21:35
GAJERA3-Nov-10 21:35 
QuestionRe: Query For CFileDialog? [modified] Pin
David Crow4-Nov-10 2:58
David Crow4-Nov-10 2:58 
AnswerRe: Query For CFileDialog? Pin
Alain Rist4-Nov-10 3:56
Alain Rist4-Nov-10 3:56 
QuestionError "string data,right truncated" generate when trying to Update by CRecordset? Pin
Le@rner3-Nov-10 18:57
Le@rner3-Nov-10 18:57 
AnswerRe: Error "string data,right truncated" generate when trying to Update by CRecordset? Pin
Stephen Hewitt3-Nov-10 19:33
Stephen Hewitt3-Nov-10 19:33 
GeneralRe: Error "string data,right truncated" generate when trying to Update by CRecordset? Pin
Le@rner3-Nov-10 19:34
Le@rner3-Nov-10 19:34 

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.