I have a VC++ 6.0 program that uses sounds and graphics. The sounds are compiled into the EXE. How can I get the graphics into the exe aswell? (They are bitmaps)
Thank you
US101
Printable View
I have a VC++ 6.0 program that uses sounds and graphics. The sounds are compiled into the EXE. How can I get the graphics into the exe aswell? (They are bitmaps)
Thank you
US101
look up resource files :cool:
Ok, I have placed all of my Graphics into a resource file. When I compile the exe, they are in the exe, as the exe os huge now. But, in my app, I am calling a class that expects a filename. At the moment I am passing it "image.bmp". That image is in a different folder, so I have to set the working dir. What I want is to pass the class a filename, but VC++ looks for that filename in my resources or something.
Any ideas? I may be going about this all wrong, but I am new to VC++
US101
I am pretty sure there are functions in the Windows API that allow you to get resources out of the resource file. I would tell you what they are... but I forgot :p
I have my app. I have another C++ class that someone else made. I call LoadGraphic() that is in the other class. LoadGraphic expects a Graphic object, also made by the same person, and a filename.
Ex.
GObject img1;
class.LoadGraphic(img1, "image1.bmp");
This basically stores image1.bmp and puts in img1. Then I can do class.DrawGraphic(img1, 0, 0); etc...
But, I want all of my images to be placed into the exe, so how do I pass a file name? If I try MAKEINTRESOURCE(image1). then the compiler does not complain, but when I run, it says that an access violation has occured and then VC++ asks where is STRCAT.asm file??????? whatever that is
thanks
US101
Obviously this class is not capable of loading resources. There's nothing you can do except extending the class (if possible).
Loading the resource and saving it to a temporary file would be a solution, but it's simply not worth it.
Its also not a very good idea to save all of your images into the exe. What happens when you want to update? Instead of your users having to download a 65kb file, they have to download a 3.5mb file.
Z.
I thought there was a limit on bitmap size in a resource? 64K or something :confused: