Filters for opening files...

Started by
3 comments, last by Boltimus 21 years, 6 months ago
Okay I got the common dialog box working to open files with GetOpenFileName but I''m getting garbage letters in the file type text area. I used the following format for the filter (which is entered for the LPCTSTR lpstrFilter member) Anyhow here''s how I did it, does this look right? char filter[] = TEXT("Text Files (*.txt)\0*.txt\0"); file_data.lpstrFilter = filter; thx! ~Bolt "All men dream: but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity: but the dreamers of the day are dangerous men, for they may act their dreams with open eyes, to make it possible." This I did...
~Bolt"All men dream: but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity: but the dreamers of the day are dangerous men, for they may act their dreams with open eyes, to make it possible." This I did...
Advertisement
the type area isn''t affected by the filter, only file type drop-down listbox is. the initial text for the filename is whatever lpstrFile points to.
ok, then I guess my next two questions are: 1.) is what I put up ok for the drop down box? cause I still am getting garbage letters. and 2.) how do I get to the file type extensions?

thx!
~Bolt"All men dream: but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity: but the dreamers of the day are dangerous men, for they may act their dreams with open eyes, to make it possible." This I did...
are you getting garbage in the textbox or in the listbox? your filter is fine.
the files of type drop down box has the garbage characters...I have nothing in the file name (which is fine with me) it''s the files of type that I want to get right...

thx!!

~Bolt

"All men dream: but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity: but the dreamers of the day are dangerous men, for they may act their dreams with open eyes, to make it possible." This I did...
~Bolt"All men dream: but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity: but the dreamers of the day are dangerous men, for they may act their dreams with open eyes, to make it possible." This I did...

This topic is closed to new replies.

Advertisement