Four file extensions turn up around Windows resources, and two of them look confusingly like the other two. .rc and .res belong to one world; .resx and .resources belong to a different one. This guide explains what each is, how it is made, and where it ends up.
The short version
| Extension | World | Form | Text or binary | Compiled from | Ends up in |
|---|---|---|---|---|---|
.rc | Native Win32 | source script | text | hand-written | a .res |
.res | Native Win32 | compiled | binary | a .rc | an .exe or .dll |
.resx | .NET | source | text (XML) | designer or hand | a .resources |
.resources | .NET | compiled | binary | a .resx | a .NET assembly |
The native side and the .NET side are parallel pipelines. They are not interchangeable, and one is not a newer version of the other.
The native Win32 side
.rc, the resource script
A .rc file is a plain-text script. You write it (or a tool generates it) and it defines the resources a native application carries: dialogs, menus, string tables, accelerators, version information, and pointers to icon, bitmap, cursor, and manifest files. It is the human-readable source form. Nothing loads a .rc at runtime.
.res, the compiled resource file
A resource compiler turns a .rc into a .res. This is a binary file that holds the same resources in the layout the linker expects. It is an intermediate build artifact. In a Delphi project you pull one in with {$R myresources.res}; a C or C++ linker takes the .res directly.
Resources inside an .exe or .dll
When the linker builds the final binary, the resources from the .res are written into the PE file’s resource section. From then on the application reaches them at runtime through the Windows API (FindResource, LoadResource, LoadString, and so on). Resource Builder can open the finished .exe or .dll and edit those resources in place, patching the binary directly without going back to the .rc or relinking.
Related native file types
You will also see:
.dcr: a Delphi component resource. Same binary layout as a.res, used to carry a component’s palette icon..drc: a Delphi-generated resource script, the.rc-equivalent text the compiler can emit..manifest: an XML file that becomes anRT_MANIFESTresource in the binary. It declares things like DPI awareness and the requested execution level.
The .NET side
.resx, the .NET resource source
A .resx file is XML. It is the source form used while you develop a .NET application, and it holds strings, images, icons, and serialized objects, each entry keyed by a name. It is usually edited through the Visual Studio resource designer, though it is also editable as plain XML or in a dedicated editor.
.resources, the compiled .NET resource file
The build turns a .resx into a binary .resources file, which is then embedded into the compiled .NET assembly as a named stream. At runtime the application reads entries back by name through ResourceManager or a ResourceReader.
How this differs from the native side
.NET resources are keyed by name and typed as CLR types (System.String, System.Drawing.Bitmap and so on). They have nothing to do with the native RT_ICON / RT_BITMAP / RT_STRING types. A .NET assembly is still a PE file, so it can also carry native resources: its version information, its application icon, and its manifest are native RT_* resources, entirely separate from the managed .resources streams inside it.
How the two relate
They run in parallel:
.rc -> compile -> .res -> link -> resources in an .exe / .dll
.resx -> compile -> .resources -> embed -> a stream in a .NET assembly There is one bridge. You can convert a .resx or .resources file into a native .res or .rc: bitmap, icon, and cursor entries become real BITMAP, ICON, and CURSOR resources, and every other entry becomes a named RCDATA block. There is no meaningful conversion the other way as a file operation. See Converting .resx to native Win32 resources.
Which one do you have, and which do you want
- You have a
.rcand want a binary to link: compile it to a.res. - You have a
.resor an.exe/.dlland want to see or change what is inside: open it in a resource editor. - You have a
.resxand no Visual Studio: edit it directly. See Editing .resx and .resources files without Visual Studio. - You have a
.resourcesblob and want to read it: open it the same way as a.resx. - You want to know what changed between two builds or two resource files: diff them. See Comparing two EXE or DLL files for resource differences.
Where Resource Builder fits
Resource Builder opens and edits all four, plus resources inside .exe/.dll binaries. It compiles .rc to .res, edits native resources in a binary in place, opens and saves .resx and .resources, and converts between the .NET and native forms. There is a free 30-day trial on the Download page.