|
-
Jun 11th, 2002, 02:49 PM
#1
Thread Starter
Member
URGENT!! Compiler ?'s
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
-
Jun 11th, 2002, 02:51 PM
#2
Frenzied Member
look up resource files
-
Jun 11th, 2002, 03:57 PM
#3
Thread Starter
Member
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
-
Jun 11th, 2002, 04:36 PM
#4
Frenzied Member
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
Harry.
"From one thing, know ten thousand things."
-
Jun 11th, 2002, 04:51 PM
#5
Thread Starter
Member
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
-
Jun 12th, 2002, 05:16 AM
#6
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 12th, 2002, 09:46 AM
#7
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.
-
Jun 12th, 2002, 11:55 AM
#8
Monday Morning Lunatic
I thought there was a limit on bitmap size in a resource? 64K or something
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|