Resource File VS2010: Images missing when copying product - c++

I am creating a c++ dll which includes some images in the png format using VS2010. This works fine as long as I keep the dll on my developer machine. When I try to copy the dll to another machine the images are missing.
When I compile my project, a file called app.res is placed in the build directory. If I look into that file, it seems to contain some binary encoded pngs. The project settings contain a entry called "Resource File Name" in the "Resources" section. The value is "app.res". Therefor I assume that my resources are added to the dll. However, it apperently doesn't work that way.
Does anyone have any ideas what could be wrong here?
Does anyone know of any good instructions on how to deals with resource files in VS2010. The Microsoft documents just didn't help much..

The linker embeds the .res file in the DLL. Verify this with File + Open + File, select your DLL, you can browse the embedded resources. There is otherwise no mechanism to make embedded resources disappear when you copy the DLL, they are firmly embedded.

Related

Register ActiveX Control without an ocx file

I am adding functionality to an open source project which uses an external activex control known as DMGraph (http://www.codeproject.com/Articles/310494/D-Graph-ActiveX-Control-in-Cplusplus-with-ATL-No-M?msg=4567275#xx4567275xx) but I get an error that the control needs to be registered when I try opening the resource file that uses this control. As stated on the project page that I linked, there is no ocx file, but I don't understand how I'm supposed to register this control without said file. If its any help to finding the issue, I have simply downloaded the source code to this open source project that i'm trying to get this work in. It has already implemented the DMGraph functionality and works in their builds so the issue must be with trying to build it on a different machine. Any ideas?

How do i put raw binary data from file into Windows resource file and extract in into void* in my program? [duplicate]

So I have a Visual Studio 2008 project which has a large amount of binary data that it is currently referencing. I would like to package the binary data much like you can do with C# by adding it as a "resource" and compiling it as a DLL.
Lets say all my data has an extension of ".data" and is currently being read from the visual studio project.
Is there a way that you can compile or link the data into the .dll which it is calling?
I've looked at some of the google link for this and so far I haven't come up with anything - the only possible solution I've come up with is to use something like ResGen to create a .resources file and then link it using AssemblyLinker with /Embed or /Link flags. I dont think it'd work properly though because I dont have text files to create the .resources files, but rather binary files themselves.
Any advice?
Right click the resource script (.rc file)
Choose Import
http://msdn.microsoft.com/en-us/library/saced6x2.aspx
You can embed any "custom" file you want, as well as things like .bmps and stuff VisualStudio "knows" how to edit. Then you can access them with your framework's resource functions like FindResource LoadResource etc...
If you don't have a resource script.
Click Project
Add New Item
Resource Script
http://msdn.microsoft.com/en-us/library/sxdy04be(v=VS.71).aspx
You can embed the binary data as a C language array - no resources involved at all.
An old classic trick.
see for example XD

SFML not loading image (Possibly due to placing in wrong place?)

I'm not sure whether I'm doing something stupid or visual studio is doing something wrong.
I've never really used C++ with VS before, but I managed to get SFML working, and now I cannot load images.
This is how I put the image in the project:
However when I write:
if (!tileTexture.loadFromFile("ConceptTile.png"))
return EXIT_FAILURE;
It returns EXIT_FAILURE.
Can anyone give an answer to why this isn't working?
If it helps that png file isn't appearing anywhere in the debug directories, just dlls, exes, and pdbs.
I've looked online to try to find out where I am supposed to put images but I can't find any articles or help no matter what keywords I type.
Make sure you change the file properties within the project to copy it to the output directory. By default (and without further paths given in the string) SFML should look for the file in your working directory. You don't have to add image files to your project, if you ensure they're at the right place. Also make sure to not include them as resources (as SFML won't be able to load them without some additional code).
Open Windows Explorer and move to the folder that contains the C++ files and paste the image there and it shall work or make a folder and change the directory in code, for example, if you name the folder images :
(!tileTexture.loadFromFile("images/ConceptTile.png"))
return EXIT_FAILURE;
and it shall work.

where are images stored inside programs?

i'm new to programs so bear with me
For example, Firefox.. I go to the C/program files/mozilla/firefox folder ..but I don't see the images/buttons they used for the default theme of the program
Also, photoshop and other programs: how are the buttons, images, and other media stored (not in a folder from what I see)?
same thing when I made a simple program in visual c++, i don't see where the icon is located at?
thanksvery much
Images are usually stored as resources in DLL or EXE files.
You can see the resources by opening a compiled binary in Visual Studio.
Firefox stores images in JAR files for skins.
In the resource section of the executable file. This section of file acts as an embedded storage location which is indexed by the resource table.
You can use a program such as ResHacker to browse or even change native embedded resources.

how do I specify the source code directory in VS when looking at the call stack of a memory dump?

I am analyzing a .dmp file that was created and I have a call stack which gives me a lot of info. But I'd like to double click on the call stack and have it bring me to the source code.
I can right click on the call stack and select symbol settings.. where I can put the location to the PDB. But there is no option for the source code directory.
The source code directory is unfortunately hard coded into the pdb's however if you know the folders required you can use windows concept of symbolic links, junctions.
I use the tool Junction Link Magic
Read this article about how to set up a Source Server (aka SrcSrv) integration at your site.
I took the time to follow these steps for our codebase, and now we are able to take a .dmp file from any build of our software in the past 6 months... get a stack trace with symbols... and view the exact source code lines in the debugger. Since the steps are integrated into our automated builds, there's very little overhead now.
I did need to write a custom indexer for ClearCase, but they have pre-existing ones for Perforce, TFS, and maybe others.
It is worth noting that the .dmp support in VS2005 is a little shaky.. it's quite a bit more stable in VS2008.
You'll also need to configure Visual Studio to grab the symbols for the MS products from here in addition to your own symbol server:
http://msdl.microsoft.com/download/symbols
That is described in a few places such as on the Debugging Tools for Windows site.
Windbg allows you to setup source paths same as PDB's paths.
After loading the PDB, manually navigate to the source file that matches the current execution location. A PDB contains the path and filename of the source files that built its associated binary, and I suspect the debugger is smart enough to hook things up when it notices that the filename being displayed and the filename associated with with current binary location, match.