|
-
Mar 15th, 2008, 12:49 PM
#1
Thread Starter
Frenzied Member
[2005] Creating Formats
Hello, is it possible for me to create my own type of file format which only my program can view or is compatible with?
If yes then how would i make the file format and how would i make my program able to view it? Im guessing my program will have to be the one to create the file.
-
Mar 15th, 2008, 02:13 PM
#2
Frenzied Member
Re: [2005] Creating Formats
Just change the extension! It's as simple as that! Then, only your program will know what to do/how to open the file.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Mar 15th, 2008, 02:26 PM
#3
Re: [2005] Creating Formats
Yes, obi1kenobi is right. If your program is saving the file, than just save it with a different extension.
Be sure to open it using that same extension aswell obviously.
However, windows will not automatically recognize that your file format belongs to your program (for example, if you rename something to ".txt", windows will usually open it with notepad. If you would rename a file to ".yourextension", this will probably not happen.
I'm not sure how to make that happen, you probably have to do some registry editing.
-
Mar 15th, 2008, 02:33 PM
#4
Thread Starter
Frenzied Member
Re: [2005] Creating Formats
Thankyou for your help that seems very simple.
-
Mar 15th, 2008, 02:33 PM
#5
Frenzied Member
Re: [2005] Creating Formats
No, actually I remember reading somewhere on this forum about a way to make Windows recognize your format as the native format of your application. I'll do a bit of searching and if I find the thread I'll post it.
EDIT: Here it is, I've found it: http://www.vbforums.com/showthread.php?t=503333
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Mar 15th, 2008, 10:16 PM
#6
Re: [2005] Creating Formats
All files are simply bytes on a disc. Any application can write bytes to a disc, so any application can create a file of your type, AS LONG AS IT KNOWS THE FORMAT. The file extension is just a way to tell Windows and other applications how to handle a file. It doesn't actually change the file itself. If you change the extension of a Word document to ".xyz" then Windows won't know it's a Word document but it still is. If you open Word and point it to that file it will open it up as normal. Any other application can read or write a compatible file as long as it understands the format.
Mnay binary file formats are very complex, so working out the spec by reverse engineering is difficult. Microsoft have released the spec for Office file formats publicly, so anyone can create applications that can read or write Office documents. The same goes for the PDF format and many others. Sometines you need to pay a license fee if you want use a proprietary file format.
So, to you. You can define your file format any way you like. It might be binary or text. Unless you put measures in place anyone will be able to read, write and otherwise use your file format. That's assuming they'd have a reason to do so, which is unlikely. The file extension will indicate to Windows that it's a file of your type, so it will then use the registered file association to open your application when the user executes a file of that type. Other than that a file is just a file and any app is free to make anything it wants of any file.
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
|