Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on CWinApp::DoPromptFileName

Status
Not open for further replies.

gjcsot

Programmer
Oct 16, 2002
9
GB
I'm using Visual C++ version 5 and I wish to edit the file extension options shown in the standard FileOpen dialog (that appear on the OnFileOPen Commard) so that there is a list of different file extension, but they appears to be no help on the CWinApp::DoPromptFileName operation. Can you point me in the right place to find out how to change this list? Do I need a different document template for each file type even if they a handle in the same way once opened?
 
see here, for my windows app, I've got:
static OPENFILENAME ofn; <- open file name structure

then just make a filter of strings:
static TCHAR Filter[] = TEXT(&quot;Text Files (*.txt)\0*.txt\0&quot;) TEXT(&quot;Ascii files (*.asc)\0*.asc\0&quot;);

etc etc for any filenames you want

then
ofn.lpstrFilter = Filter; //your filters from before
ofn.lpstrDefExt = TEXT(&quot;bob&quot;); //default extension The weevil of doooooooooom
-The eagle may soar, but the weasel never gets sucked up by a jet engine (Anonymous)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top