From 132964d838ed9b93bd673dca38699a9e9853ba7e Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Tue, 12 Mar 2013 00:33:30 +0100 Subject: [PATCH] Store some resources in the DLL. --- example/SampleDLL/.gitignore | 1 + example/SampleDLL/Makefile | 8 +++++++- example/SampleDLL/SampleDLL.rc | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 example/SampleDLL/SampleDLL.rc diff --git a/example/SampleDLL/.gitignore b/example/SampleDLL/.gitignore index 41f4fda..ecc2285 100644 --- a/example/SampleDLL/.gitignore +++ b/example/SampleDLL/.gitignore @@ -1,2 +1,3 @@ *.o *.dll +*.res diff --git a/example/SampleDLL/Makefile b/example/SampleDLL/Makefile index ec4a04b..78c5e1e 100644 --- a/example/SampleDLL/Makefile +++ b/example/SampleDLL/Makefile @@ -7,17 +7,20 @@ endif CC = $(PLATFORM)-w64-mingw32-gcc CXX = $(PLATFORM)-w64-mingw32-g++ LINK = $(PLATFORM)-w64-mingw32-ld +RC = $(PLATFORM)-w64-mingw32-windres else CC = gcc CXX = g++ LINK = ld +RC = rc endif RM = rm CFLAGS = -Wall -g -DSAMPLEDLL_EXPORTS LDFLAGS = -shared +RCFLAGS = -O coff -OBJ = SampleDLL.o +OBJ = SampleDLL.o SampleDLL.res SampleDLL.dll: $(OBJ) $(LINK) $(LDFLAGS) -o SampleDLL.dll $(OBJ) @@ -25,5 +28,8 @@ SampleDLL.dll: $(OBJ) %.o: %.cpp $(CXX) $(CFLAGS) -c $< +%.res: %.rc + $(RC) $(RCFLAGS) -o $*.res $< + clean: $(RM) -rf $(OBJ) SampleDLL.dll diff --git a/example/SampleDLL/SampleDLL.rc b/example/SampleDLL/SampleDLL.rc new file mode 100644 index 0000000..6f73854 --- /dev/null +++ b/example/SampleDLL/SampleDLL.rc @@ -0,0 +1,34 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "fancy.code" + VALUE "FileDescription", "SampleDLL" + VALUE "FileVersion", "1.0" + VALUE "InternalName", "SampleDLL" + VALUE "LegalCopyright", "Copyright (c) 2013 Joachim Bauch" + VALUE "OriginalFilename", "SampleDLL.dll" + VALUE "ProductName", "MemoryModule" + VALUE "ProductVersion", "0.0.3" + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +#define IDS_HELLO 1 +#define IDS_WORLD 20 + +STRINGTABLE +{ + IDS_HELLO, "Hello" + IDS_WORLD, "World!" +}