Resource files are those files that are used to instruct the compiler/linker toolchain on which resources (icons, dialogs, etc.) are to be embedded in the binary being built.
Questions tagged [resource-files]
267 questions
106
votes
5 answers
Carriage Return/Line Feed in .Net Resource File (App_GlobalResources)
I'm keeping several texts in an App_GlobalResources.resx file.
The texts have to be multi-line and I need to have them contain line feeds. However, when I read the contents, all line feeds are gone (\r\n is printed, not as CRLF 10 13 control…

Alex
- 75,813
- 86
- 255
- 348
43
votes
4 answers
Visual Studio : can't find "resource file" in list of items to add to project
I'm on VS Community 2017 RC.
I'd like to add a resource file (.resx) to my project but this item type is not listed in the items
Have I missed something ? Do I need to install anything on top of my Visual Studio to be able to manage resource files ?

bob
- 774
- 1
- 7
- 16
38
votes
2 answers
How to see if resource file exists in Java?
I am trying to output text to a resource file in Java like so:
File file = new File(MLM.class.getClassLoader().getResource("mazes.txt").toString());
BufferedWriter out = new BufferedWriter(new FileWriter(file));
..
but because the resource file has…

flea whale
- 1,783
- 3
- 25
- 38
34
votes
3 answers
Inaccessible, Internal, Resource Files?
I am building an ASP.NET MVC 4 website with C#. I am localizing all of my static strings in a Resource File (.resx). I use the Visual Studio interface for creating and populating the resource file. In my index.cshtml view, I try to use one of the…

Oliver Spryn
- 16,871
- 33
- 101
- 195
31
votes
3 answers
Visual Studio duplicating resource .cs file
Visual Studio has begun exhibiting a rather irritating quirk. When I edit a resource file (using either the designer view or editing the XML directly), it creates a duplicate resource Designer.cs file, which causes the project to be unable to…

iandisme
- 6,346
- 6
- 44
- 63
17
votes
2 answers
What are the macros in resource.h used for?
When a resource file is created in visual studio, the IDE automatically generates a header file called resource.h with this text:
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by BackupRestore.rc
// Next default…

Matt
- 482
- 1
- 6
- 15
17
votes
5 answers
PYQT4 - How do I compile and import a qrc file into my program?
I'm having trouble importing a resource file. I'm using pyqt4 with monkey studio and I am trying to import a png image. When I run the program I get an import error like
ImportError: No module named icon_rc
I know that I have to compile it using…

Thomas
- 1,199
- 3
- 13
- 25
15
votes
1 answer
How to use string interpolation in a resource file?
I would like to use a resource file to send an email. In my resource file I used a variable "EmailConfirmation" with the value "Hello {userName} ... "
In my class I used:
public static string message (string userName)
{
return…

Jahack
- 173
- 1
- 4
15
votes
1 answer
How do I build a Win32 app with a resource file using cmake and MinGW?
In theory, it's very easy to build a Win32 app with a resource file using cmake. In an add_executable command, a resource file can be listed as easily as a C or C++ source file. There is a known bug, however, when building using MinGW tools.
I found…
user180247
15
votes
9 answers
Are there any performance issues or caveats with resource (.resx) files?
Resource files seem great for localization of labels and messages, but are they perfect?
For example:
Is there a better solution if there is a huge amount of resources? Like 100,000 strings in a .resx file? (Theoretically, I do not actually have…

John B
- 20,062
- 35
- 120
- 170
11
votes
1 answer
How to do inheritance of Resource files (resx)
Imagine you're working on a .Net 4.0 project that is made up of hundreds of assemblies, each having its own resource file (.resx) for localization. The localized strings are accessed from C# through classes auto-generated with ResXFileCodeGenerator…

Fueled
- 8,776
- 9
- 29
- 31
11
votes
1 answer
CodeBlocks - How to add an icon to a C program?
I have a small C console program and I want to add an .ico file to it, so that the executable looks nice.
How can I do this in CodeBlocks with MinGW/gcc?

user136036
- 11,228
- 6
- 46
- 46
11
votes
2 answers
Is it possible to define string arrays in .resx resource files?
Currently, I do this:
Names -> "name1|name2|name3"
Resource.Names.Split('|');
Is it possible to define those names as an array in the resource file so that I don't have to parse by splitting every time?
Something like the following…

randomguy
- 12,042
- 16
- 71
- 101
11
votes
1 answer
How to put variable value inside value of resource file
I have been working with resource files for a while now and I was wondering if there is some nifty way I don't know of yet to put variables inside a resource value.
A simple example:
You have bought #amountOfBooksBought books.
My current way of…

Peter
- 14,221
- 15
- 70
- 110
10
votes
2 answers
CMake and Visual Studio resource files
I am converting a C++ project created using Visual Studio 2005 to CMake and have stumbled upon a bit of a problem with resource files that are included in the project.
The project includes a .rc file, a bunch of .ico files and a .rc2 file.
The…

villintehaspam
- 8,540
- 6
- 45
- 76