Thread: Hot to use resources in Visual C++?

  1. #1

    Hot to use resources in Visual C++?

    Hi, I'm a Visual C++ newbie(I know C++ on a high level, and I haven't programmed windows before, I just need Visual C++ for SDL), and I would like to know, how can I add resource files(images, and sounds) to my exe file, and how can I access these added files, as individual files!
    Please note, that I don't know anything about MFC and windows programming!

    Thanks in advance!

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    "Programming Windows" by Charles Petzold
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Visalia, CA, USA
    A book is good advice but I'm sure you want something now. You use functions such as LoadIcon, LoadImage, LoadBitmap (this is better for resource files than LoadImage), LoadFont, and there are a couple others. You can find them all at

    HBITMAP MyImage = LoadBitmap(hInst, "MyResourceName");

  4. #4
    train spotter
    Join Date
    Aug 2001
    near a computer
    LoadImage() is the latest version of LoadBitmap().

    Can only use BMP's not other image types in GDI (MS has added some in GDI++).

    To play sounds look for (suprisingly) PlaySound() or lookup Wave form audio (WM_WOM_OPEN msg's)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM