|
-
Jan 4th, 2009, 10:52 PM
#1
Thread Starter
Lively Member
[2005] Create file type
I have seen several programs that use their own unique file type.
I cannot find in VS2005 where to assign a file type for the project. In fact, it says that changing file types will cause the program to not be able to use the files. ???
So can I change my database to data.bob or a text file to list.bob ?
Or does that only apply to files created by the finished application. Even at that, I haven't seen where to designate the .type of output files.
Last edited by Amerigo; Jan 4th, 2009 at 11:25 PM.
-
Jan 5th, 2009, 12:01 AM
#2
Re: [2005] Create file type
Any file is just a bunch of bytes. The filetype of a file, recognised by the OS from the file extension (.doc, .rar), just tells the OS which program knows what to do with that file.
If you are looking to create application specific files, take a look at class serialization. Once you create a filestream using serialization, you can name the file with whatever extension you choose. If you want users to be able to double click on that file and automatically open it with your program, take a look at second post in this thread.
This isn't magic either though. When you double click on the file and your program opens, the OS actually passes the filename as a string into your applications startup event handler. To tell your program what to do with it, you'll have to write some code!
You can access the Application.StartupEvent() from the projects property screen by clicking the View Application Events button and then selecting Startup from the dropdown events list.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|