Results 1 to 8 of 8

Thread: URGENT!! Compiler ?'s

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2001
    Location
    Los Angeles
    Posts
    45

    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

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Thumbs up

    look up resource files

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2001
    Location
    Los Angeles
    Posts
    45
    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

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    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."

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2001
    Location
    Los Angeles
    Posts
    45
    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

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  7. #7
    Zaei
    Guest
    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.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
  •  



Click Here to Expand Forum to Full Width