DevCpp file & library extensions

Started by
5 comments, last by yckx 12 years, 8 months ago
[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.[/font]
Advertisement
What???

Regardless, don't use DevC, it's ancient and crappy.
:unsure: Well, is there an IDE suite of the same syntax? I still want to know about my last post...
Microsoft Visual C++ Express and Code::Blocks 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?

Edit: 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
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.

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.

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).

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.

...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 :?

This topic is closed to new replies.

Advertisement