embedded-resource

GetManifestResourceStream returns NULL

浪子不回头ぞ 提交于 2019-11-27 18:39:13
This is a C# .NET 4.0 application: I'm embedding a text file as a resource and then trying to display it in a dialog box: var assembly = Assembly.GetExecutingAssembly(); var resourceName = "MyProj.Help.txt"; using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { using (StreamReader reader = new StreamReader(stream)) { string result = reader.ReadToEnd(); System.Windows.Forms.MessageBox.Show(result, "MyProj", MessageBoxButtons.OK); } } The solution is MyProjSolution and the executable is MyProj.exe. Help.txt is an embedded resource. However, the stream is null. I've tried

How do I add a TXT file as resource to my EXE file?

元气小坏坏 提交于 2019-11-27 17:21:35
问题 I have a TXT file containing about 10,000 lines of text. I want to display these lines in a TMemo. But I don't want to distribute that TXT file my program. How do I integrate it into my EXE file as a resource WITHIUT using stringtable {} because this requires an identifier for each line (so I will have to add 10000 identifiers). _ I have Delphi XE 回答1: I usually create an RC file (which is basically an text file) for this kind of resources, then add line like MyText RCDATA ..\resources

Where do resource files go in a Gradle project that builds a Java 9 module?

只谈情不闲聊 提交于 2019-11-27 14:23:56
As of IDEA 2018.2.1, the IDE starts error-highlighting packages "not in the module graph" from dependencies that have been modularized. I added a module-info.java file to my project and added the requisite requires statements, but I'm now having trouble accessing resource files in my src/main/resources directory. (For a complete example, see this GitHub project .) When I used ./gradlew run or ./gradlew installDist + the resulting wrapper script, I was able to read resource files, but when I ran my app from the IDE, I wasn't. I filed an issue with JetBrains, and what I learned was that IDEA was

Is there any standard way of embedding resources into Linux executable image? [duplicate]

余生颓废 提交于 2019-11-27 12:24:34
This question already has an answer here: Embedding resources in executable using GCC 4 answers It is quite easy to embed binary resources into PE images (EXE, DLL) via Windows API (refer to http://msdn.microsoft.com/en-us/library/ms648008(v=VS.85).aspx ). Is there any similar standard API in Linux? or maybe some kind of de-facto approach to resource embedding? The goal is to embed some static binary and/or textual data into executable, e.g. pictures, HTMLs, etc.. so that program binary distribution is as simple as making one file copy? ( assuming all library dependencies are ok ) Update:

How to embed multilanguage *.resx (or *.resources) files in single EXE?

穿精又带淫゛_ 提交于 2019-11-27 12:18:48
问题 There are plenty of tutorials how to create multilanguage RESX files and how to create satellite assemblies with AL.exe, but I haven't found working example how to embed RESX/Resources/satellite-DLL files in single EXE file and distribute whole multilanguage app as such EXE. I tried to use ilmerge.exe, but it looks like it doesn't work for multiple DLLs with the same name (culture satellite DLLs have identical names, originally residing in different subdirs named after culture). I also don't

The view must derive from WebViewPage, or WebViewPage<TModel>

大兔子大兔子 提交于 2019-11-27 10:54:43
I'm following Justin Slattery's Plugin Architecture tutorial and trying to adapt it for Razor, instead of WebForm Views. Everything else (controllers, plugin assembly loading, etc) seems to be okay. However, I'm not able to get embedded Razor views to work properly. When I try to browse to the "HelloWorld/Index", I get the following error: The view at '~/Plugins/MyProjectPlugin.dll/MyProjectPlugin.Views.HelloWorld.Index.cshtml' must derive from WebViewPage or WebViewPage<TModel>. The exception is thrown by System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object

Can I link a plain file into my executable? [duplicate]

旧城冷巷雨未停 提交于 2019-11-27 10:51:52
This question already has an answer here: C/C++ with GCC: Statically add resource files to executable/library 7 answers Some frameworks (Qt, Windows, Gtk...) offer functionality to add resources to your binaries. I wonder if it would be possible to achieve this without the framework, since all that is really needed is a symbol to contain the resource's address within the binary (data segment) a symbol to represent the length of the resource the resource itself How can this be achieved with the gcc toolchain? You could do this: objcopy --input binary \ --output elf32-i386 \ --binary

How to check if image object is the same as one from resource?

自闭症网瘾萝莉.ら 提交于 2019-11-27 09:46:19
So I'm trying to create a simple program that just change the picture in a picture box when it's clicked. I'm using just two pictures at the moment so my code for the picture box click event function looks like that: private void pictureBox1_Click(object sender, EventArgs e) { if (pictureBox1.Image == Labirint.Properties.Resources.first) pictureBox1.Image = Labirint.Properties.Resources.reitmi; else if (pictureBox1.Image == Labirint.Properties.Resources.reitmi) pictureBox1.Image = Labirint.Properties.Resources.first; } For some reason the if statement it's not working and the picture don't

How to Read an embedded resource as array of bytes without writing it to disk?

我的梦境 提交于 2019-11-27 09:40:14
In my application I compile another program from source.cs file using CodeDom.Compiler and I embed some resources ( exe and dll files ) at compile time using : // .... rest of code if (provider.Supports(GeneratorSupport.Resources)) { cp.EmbeddedResources.Add("MyFile.exe"); } if (provider.Supports(GeneratorSupport.Resources)) { cp.EmbeddedResources.Add("New.dll"); } // ....rest of code In the compiled file, I need to read the embedded resources as array of bytes. Now I'm doing that by extracting the resources to disk using the function below and the use File.ReadAllBytes("extractedfile.exe");

Creating a “.rc” file in Visual Studio 2010 Express

*爱你&永不变心* 提交于 2019-11-27 07:13:35
问题 I'm trying to learn game programming. I am using Microsoft Visual Studio 2010 Express on Windows Vista. I want to know how to create a resource file (.rc). The microsoft website gives some fairly ambiguous instructions on creating one. http://msdn.microsoft.com/en-us/library/sxdy04be.aspx. If I go to my Solution explorer , right click and select Add New Item , the IDE does not give a .rc file as one of the options. It only gives me a .cpp, .h and windows form as options. I don't know what to