[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

default file extension

Posted on 1999-11-21
8
Medium Priority
?
223 Views
Last Modified: 2013-11-20
I'm writing a VC++ SDI program. I want to know how to set the default file extension for my application. Like if u use the wordpad.. the default file extension is ".wri"
0
Comment
Question by:rw8
8 Comments
 
LVL 1

Expert Comment

by:abhitlya
ID: 2224081
Hi,

Here's what you can do. Go into the Resource Editor and edit the String Table entry for resource IDR_MAINFRAME.

Test\Test Document\nTestDoc\nTestDocs (*.my)\n.my\nTestDoc\nMyTestDoc

This will cause the default file extension to be ".my" in File-Save dialog box.

Regards,
Abhijit
0
 

Author Comment

by:rw8
ID: 2224112
Can u briefly explain what does that line mean?
Anyway,I got an error message when I put "Test\Test Document\nTestDoc\nTestDocs (*.my)\n.my\nTestDoc\nMyTestDoc" as the caption for the IDR_MAINFRAME. THen I removed everything after (*.my) and it seems ok..  is that what I should do? also, when I choose "open" from my applciation, the file type is still  "all file *.*", I wanted it to be also (*.my).. can u tell me how to do that?
0
 
LVL 8

Expert Comment

by:Vinayak Kumbar
ID: 2224152
Hi,

I think good way will be to over ride those functions and handle them, where in U can give the extenstion in the form of filter.
To do that take a look at the example in OnFileOpen() functions help.

Try it out.
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
LVL 1

Expert Comment

by:olgat
ID: 2224827
Hi,
What abhitlya said is correct, but it is only the part of process.
There are some more steps.
It is really long, so I'll just give you a good reference :-)
On MSDN, in MSJ 1996 February issue you can find in an article "Programming Windows 95 with MFC, Part VII: The Document/View Architecture"
written  by Jeff Prosise with full explanation.

In this article pay attention on 2 chapters:
"More on the SDI Document Template"
and
"Registering Document Types"

If you have any additional questions, don't hesitate to ask me.




0
 
LVL 1

Expert Comment

by:abhitlya
ID: 2224895
Hi,

I am sorry about that typing mistake. There should be a "\n" instead of the "\" in the string. The string is actually divided into 7 parts each of them separated by a "\n", and there's no carriage return in the entire string.

Here's the changed string...

Test\nTest Document\nTestDoc\nTestDocs (*.my)\n.my\nTestDoc\nMyTestDoc

And here's a brief description about what each of the "\n" separated portions means...

1. The window title (not used for MDI applications)
2. The document name
3. Description of the type of document for use when creating a new document
4. Description of the file type for the standard File Open dialog
5. An extension filter
6. Description of file type for use by the File Manager
7. The ProgID that is registered in the Windows Registry

Regards,
Abhijit
0
 
LVL 1

Expert Comment

by:abhitlya
ID: 2224896
Hi,

I am sorry about that typing mistake. There should be a "\n" instead of the "\" in the string. The string is actually divided into 7 parts each of them separated by a "\n", and there's no carriage return in the entire string.

Here's the changed string...

Test\nTest Document\nTestDoc\nTestDocs (*.my)\n.my\nTestDoc\nMyTestDoc

And here's a brief description about what each of the "\n" separated portions means...

1. The window title (not used for MDI applications)
2. The document name
3. Description of the type of document for use when creating a new document
4. Description of the file type for the standard File Open dialog
5. An extension filter
6. Description of file type for use by the File Manager
7. The ProgID that is registered in the Windows Registry

Regards,
Abhijit
0
 

Author Comment

by:rw8
ID: 2226275
Thanx for your help olgat, but sorry.. I think abhitlya should receive the points.
abhitlya, can you post your answer as asnwer again so that I can accept it?

0
 
LVL 1

Accepted Solution

by:
abhitlya earned 150 total points
ID: 2227082
Hi,

Here's the changed string...

Test\nTest Document\nTestDoc\nTestDocs (*.my)\n.my\nTestDoc\nMyTestDoc

And here's a brief description about what each of the "\n" separated portions means...

1. The window title (not used for MDI applications)
2. The document name
3. Description of the type of document for use when creating a new document
4. Description of the file type for the standard File Open dialog
5. An extension filter
6. Description of file type for use by the File Manager
7. The ProgID that is registered in the Windows Registry

Regards,
Abhijit
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question