Sign in to follow this  
Mineat

DevCpp file & library extensions

Recommended Posts

[font="Verdana"][size="5"]Hi! I was wondering how to complete a file extension with an icon and class, while making 2 projects(1 game and 1 file extension library for it) in DC++. does anyone know how I can do that? I still know how to use the "fopen" function.[/size][/font]

Share this post


Link to post
Share on other sites
[url="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express"]Microsoft Visual C++ Express[/url] and [url="http://www.codeblocks.org/"]Code::Blocks[/url] are both good, although MSVC Express is arguably better. So, back to your question: are you wanting to associate a custom file extension with a custom icon?

[b]Edit:[/b] If that's what you want to do, it looks like you'll have to edit the registry. And if you're posting in the For Beginners forum, may I suggest you just save that task for later. Editing the registry when you don't know what you're doing is a surefire way to break your computer :P

Share this post


Link to post
Share on other sites
I was looking to make a file extension from scratch before registering it(last), by making a class and several files from scratch and putting it it one, but it's okay. I'm working on another computer on a portable drive while using portable apps compatible with CodySafe.

Share this post


Link to post
Share on other sites
[quote name='Mineat' timestamp='1313462958' post='4849677']
I was looking to make a file extension from scratch before registering it(last), by making a class and several files from scratch and putting it it one, but it's okay. I'm working on another computer on a portable drive while using portable apps compatible with CodySafe.
[/quote]
What you are saying doesn't make much sense. May I suggest reformulating your question in a different way ? Right now, nobody is really understanding what you are after :)

Assuming it is like yckx guessed, then this doesn't work the way you described. You do not create file associations from your application code. Well, theoretically you could, but this may require an elevated access token and is generally regarded as very bad practice. File associations, along with their icons are typically created and registered with the system by the installer when your application is installed. There is no link between this process and your code (classes, source files or anything like that).

Share this post


Link to post
Share on other sites
[quote name='Mineat' timestamp='1313462958' post='4849677']
I was looking to make a file extension from scratch before registering it(last), by making a class and several files from scratch and putting it it one, but it's okay. I'm working on another computer on a portable drive while using portable apps compatible with CodySafe.
[/quote]
...I'm not sure you have your terminology correct. A file extension is the part of the filename after the dot: so for somegame.exe the extension is EXE, and for somearchive.zip the extension is ZIP. The extension typically indicates what kind of file it is, and Windows uses file extensions to determine how to use a given file, but there's nothing preventing you from giving any file any extension you want (well, assuming you have write-access). I wouldn't go around changing file extensions--I'm just trying to show that it's trivial to create one: create a file and give it the extension you want. If you want to associate an icon and any specific actions for Windows to take with that file such as what program opens it, etc., that's done in the registry, and Yann L is correct in saying that's best done in the program installer, not from the program itself.

But it almost sounds like what you want to do is create a file archive. I'm not sure what you mean by "making a class" in this context, but taking several files and putting them into one large file sounds like making an archive file to me, like a ZIP file or a RAR file. Unless you just want to do this for the experience, I'd just recommend using a ZIP library or something similar. Professionals do this all the time--the big resource files that iD Software used (uses?) in their games were just ZIP files that were given a different file extension so it wasn't immediately obvious how to unpack the games' resources. And if it's good enough for John Carmack, it's likely good enough for you ;)

I hope some of that proves helpful to you, but I'm still not convinced I've figured out what you're trying to do :?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this