Linked Questions
22 questions linked to/from Embed Text File in a Resource in a native Windows Application
1 vote
0 answers
356 views
How to embed a XML file into EXE with VS2013 (C++) [duplicate]
I want to embed a XML file into EXE with VS2013 (i.e. I don't want to ship the XML to my customer, only the EXE). I'm using C++ (MFC), and I tried to put it into .rc file. But it gives back only ...
1 vote
0 answers
309 views
How to embed a text file in a DLL? [duplicate]
I am having a sample.dll, a sample.txt file and sample.exe. sample.exe uses sample.dll functions. I am opening sample.txt and reading its contents in sample.dll. Everytime I run sample.exe I need to ...
178 votes
23 answers
101k views
"#include" a text file in a C program as a char[]
Is there a way to include an entire text file as a string in a C program at compile-time? something like: file.txt: This is a little text file main.c: #include <stdio.h> int main(void) { #...
4 votes
5 answers
2k views
How can I get the contents of a file at build time into my C++ string?
I have a file I am compiling in C++ in which I wish to have a string whose value is the contents of a file at the time of compilation. In other words, I'd like to #include the file but have that be ...
6 votes
3 answers
2k views
How to encode external files that come with the .exe
So I made an application with visual 2012 that loades images and shaders (plain text). But really, I don't want people to open the images and shaders and mess around. How can I compress all this ...
7 votes
1 answer
10k views
Reading an embedded text file resource Visual Studio C++
Here are the steps I took to add a text file as a resource: 1. Right click project, add New Item 2. Choose text file, click add 3. Go to project properties, configuration properties->Linker->Input->...
5 votes
1 answer
1k views
Print function contents as string but also be able to run it as code
I would like to make a function that can print the contents of another function without breaking the functionality of the copied function. For example: int functionToCopy() { int a{ 5 }; int b{...
2 votes
1 answer
2k views
Best practice to protect resources against reverse engineering [closed]
In order to address some level of protection against reverse engineering or decompilation, I decided to move the important parts of my C# application including several xml resources into a native C++ ...
3 votes
2 answers
699 views
Can you get the compiler's command-line contents from within the compiled program?
For silly reasons, I am required to have a string with the options the compiler executable got embedded in the program I'm compiling. This can be achieved by the build system or build-system-generator,...
0 votes
1 answer
873 views
How to pack multiple executable files into a single one?
I have multiple executable files. I want to write a program using cpp which will extract them to a specific location. Like unpacking a zip archive but i want it to be an executable and work in any ...
0 votes
0 answers
930 views
Embedding .txt files into a C++ executable directly [solved]
Is there a way to embed .txt files (their text) into a binary C++ program executable? (EDIT: answered by the top comment) What I mean by that, is, I want compile some .txt files into a single ...
0 votes
0 answers
771 views
Package external csv files into c++ executable
I have created a c++ program in Visual Studio 2015 that reads in external CSV files, works on them, then produces an output. I know that in the release folder of the output directory that an .exe file ...
-1 votes
1 answer
445 views
How can I embed a bat file in my project?
Ive been using the following code to start a bat script. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { std::wstring env = GetEnvString(); env += L"...
0 votes
1 answer
411 views
How to embed a local file in an exe file generated from C++ project? [duplicate]
I have a project written in C++ that depends on a local file. At runtime, I read that file from disk. When I build the project an .exe file is generated, but I still need that file on disk for the ...