Resource ICONs

This is a discussion on Resource ICONs within the Windows Programming forums, part of the Platform Specific Boards category; I am trying to load an icon from the resource file not from a *.ico file. I used the shareware ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    4

    Resource ICONs

    I am trying to load an icon from the resource file not from a *.ico file. I used the shareware version of Resource Builder to see how they make this work and then borrowed" their code to see if I could get it to work. The code attached is the copy from the resource builder *.rc file which compiles in that program but when I try to use it I get a parse error cause by the first line. Does anyone have any ideas that would help me?

    Thanks in advance
    -Geoff Baker


    Code:
    IDI_MYICON ICON 
    MOVEABLE PURE LOADONCALL DISCARDABLE
    LANGUAGE LANG_NEUTRAL, 0
    BEGIN
    '00 00 01 00 02 00 20 20 00 01 01 00 08 00 A8 08 '
    '00 00 26 00 00 00 10 10 00 01 01 00 08 00 68 05 '
    '00 00 CE 08 00 00 28 00 00 00 20 00 00 00 40 00 '
    '00 00 01 00 08 00 00 00 00 00 00 04 00 00 00 00 '
    '00 00 00 00 00 00 00 01 00 00 00 00 00 00 FF FF '
    'FF 00 CB FE FF 00 99 FE FF 00 65 FE FF 00 33 FE '
    'FF 00 00 FD FD 00 FE CB FF 00 CB CB FF 00 99 CB '
    'FF 00 65 CB FF 00 33 CC FF 00 00 CB FD 00 FE 99 '
    'FF 00 CB 99 FF 00 99 99 FF 00 65 98 FF 00 33 98 '
    'FF 00 00 98 FD 00 FE 65 FF 00 CB 65 FF 00 98 65 '
    'FF 00 65 65 FF 00 33 65 FF 00 00 65 FD 00 FE 33 '
    'FF 00 CB 33 FF 00 98 33 FF 00 65 33 FF 00 33 33 '
    'FF 00 00 32 FD 00 FD 00 FD 00 CB 00 FD 00 98 00 '
    'FD 00 65 00 FD 00 32 00 FD 00 00 00 FD 00 FF FF '
    'CB 00 CB FF CB 00 99 FF CC 00 65 FF CB 00 33 FF '
    'CC 00 00 FD CB 00 FF CB CB 00 CC CC CC 00 98 CB '
    'CB 00 66 CB CC 00 32 CB CB 00 00 CB CC 00 FF 99 '
    'CB 00 CB 98 CB 00 98 98 CB 00 66 98 CC 00 32 98 '
    'CB 00 00 99 CC 00 FF 65 CB 00 CB 66 CC 00 98 66 '
    'CC 00 66 66 CC 00 32 65 CB 00 00 65 CC 00 FF 33 '
    'CB 00 CB 32 CB 00 98 32 CB 00 65 32 CB 00 32 32 '
    'CB 00 00 32 CC 00 FD 00 CB 00 CB 00 CC 00 98 00 '
    'CC 00 65 00 CC 00 32 00 CC 00 00 00 CC 00 FF FF '
    '99 00 CB FF 99 00 99 FF 99 00 65 FF 98 00 33 FF '
    '99 00 00 FD 98 00 FF CC 99 00 CB CB 98 00 98 CB '
    '98 00 66 CC 99 00 32 CB 98 00 00 CC 99 00 FF 99 '
    '99 00 CB 98 98 00 99 99 99 00 65 98 98 00 33 98 '
    '99 00 00 97 98 00 FF 65 98 00 CC 66 98 00 98 65 '
    '98 00 65 65 98 00 33 65 99 00 00 65 98 00 FF 33 '
    '98 00 CB 32 98 00 98 33 99 00 65 33 99 00 33 33 '
    '99 00 00 32 98 00 FD 00 98 00 CC 00 98 00 97 00 '
    '98 00 65 00 98 00 32 00 98 00 00 00 98 00 FF FF '
    '65 00 CB FF 65 00 98 FF 65 00 65 FF 65 00 33 FF '
    '66 00 00 FD 65 00 FF CB 65 00 CC CC 66 00 98 CC '
    '66 00 66 CC 66 00 32 CB 65 00 00 CC 66 00 FF 98 '
    '65 00 CC 99 66 00 98 98 65 00 65 98 65 00 33 99 '
    '66 00 00 98 65 00 FF 65 65 00 CC 66 66 00 98 65 '
    '65 00 66 66 66 00 32 65 65 00 00 65 66 00 FF 33 '
    '65 00 CB 32 65 00 99 33 65 00 65 32 65 00 32 32 '
    '65 00 00 32 66 00 FD 00 65 00 CC 00 65 00 98 00 '
    '65 00 65 00 66 00 32 00 66 00 00 00 66 00 FF FF '
    '33 00 CC FF 33 00 98 FF 33 00 66 FF 33 00 33 FF '
    '33 00 00 FD 32 00 FF CC 33 00 CB CB 32 00 98 CB '
    '32 00 65 CB 32 00 32 CB 32 00 00 CC 33 00 FF 99 '
    '33 00 CB 98 32 00 99 99 33 00 65 99 33 00 33 99 '
    '33 00 00 98 32 00 FF 66 33 00 CB 65 32 00 99 66 '
    '33 00 65 65 32 00 32 65 32 00 00 66 33 00 FF 33 '
    '33 00 CB 32 32 00 99 33 33 00 65 32 32 00 33 33 '
    '33 00 00 31 32 00 FD 00 32 00 CC 00 32 00 98 00 '
    '32 00 66 00 32 00 31 00 32 00 00 00 32 00 FD FD '
    '00 00 CB FD 00 00 98 FD 00 00 65 FD 00 00 32 FD '
    '00 00 00 FD 00 00 FD CB 00 00 CC CC 00 00 99 CC '
    '00 00 65 CC 00 00 33 CC 00 00 00 CC 00 00 FD 98 '
    '00 00 CC 99 00 00 98 98 00 00 65 98 00 00 32 98 '
    '00 00 00 98 00 00 FD 65 00 00 CC 66 00 00 98 65 '
    '00 00 66 66 00 00 32 66 00 00 00 66 00 00 FD 32 '
    '00 00 CC 33 00 00 98 32 00 00 66 33 00 00 32 32 '
    '00 00 00 32 00 00 FD 00 00 00 CC 00 00 00 98 00 '
    '00 00 66 00 00 00 32 00 00 00 00 00 EE 00 00 00 '
    'DC 00 00 00 BA 00 00 00 AA 00 00 00 88 00 00 00 '
    '76 00 00 00 54 00 00 00 44 00 00 00 22 00 00 00 '
    '10 00 00 EE 00 00 00 DC 00 00 00 BA 00 00 00 AA '
    '00 00 00 88 00 00 00 76 00 00 00 54 00 00 00 44 '
    '00 00 00 22 00 00 00 10 00 00 EE 00 00 00 DC 00 '
    '00 00 BA 00 00 00 AA 00 00 00 88 00 00 00 76 00 '
    '00 00 54 00 00 00 44 00 00 00 22 00 00 00 10 00 '
    '00 00 EE EE EE 00 DD DD DD 00 BB BB BB 00 AA AA '
    'AA 00 88 88 88 00 77 77 77 00 55 55 55 00 44 44 '
    '44 00 22 22 22 00 11 11 11 00 00 00 00 00 FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FA FA FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FA FA FA FA FA FA FA '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FA FA FA FA FA FA FA FA FA '
    'FA FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FA FA FA FA FA FA FA FA FA FA FA '
    'FA FA FA FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FA FA FA FA FA FA FA FA FF FF FA FA FA '
    'FA FA FA FA FA FF FF FF FF FF FF FF FF FF FF FF '
    'FF FA FA FA FA FA FA FA FA FF FF FA FA FF FF FF '
    'FA FA FA FA FA FA FA FF FF FF FF FF FF FF FF FA '
    'FA FA FA FA FA FA FA FF FF F9 FA D8 FA FB FB FF '
    'FF FA FA FA FA FA FA FA FA FF FF FF FF FF FA FA '
    'FA FA FA FA FA FF FF F9 F9 F9 D8 D8 FA FB FC FC '
    'FC FF FF FA FA FA FA FA FA FA FA FA FF FF FA FA '
    'FA FA FA FF FF F9 F9 F7 FA D8 D8 D8 FA FB FB FC '
    'FC FC FB FF FF FA FA FA FA FA FA FA FA FF FF FA '
    'FA FF FF F9 F9 FA F7 F7 FA F9 F9 F9 FA FB FC FC '
    'FC FB FC FC FB FF FF FA FA FA FA FA FA FA FF FF '
    'FF F9 F9 F7 D8 F9 F9 FB FA F9 F9 9F F9 FB FB FC '
    'FC FC FB FB FC FC FB FF FF FA FA FA FA FA FF F9 '
    'F9 F7 F7 F9 F9 FB FB F7 FA F9 D8 F8 F8 F9 F9 FB '
    'FB FC FC FC FB FB FC FC FB FF FF FF FA FF FF F7 '
    'F7 F9 F9 FB FB F8 F7 F7 FA F8 F8 F9 F9 F9 F9 F9 '
    'F9 FB FB FB FC FC FB FB FC FC FC FF FF FF FF F7 '
    'F9 D8 FB F8 F8 F7 F7 F7 FA FA F9 F9 F9 F9 F9 F9 '
    'F9 F9 F9 FB FB FB FC FC FB FC FC FC FB FF FF F7 '
    'FB F7 F7 F7 F7 F7 F7 F7 F7 F7 FA FA F9 F9 F9 F9 '
    'F9 F9 F9 F9 F9 FB FB FB FC FC FC FB FB FF FF F7 '
    'F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 FA FA F9 F9 '
    'F9 F9 F9 F9 F9 F9 F9 FB FB FC FC FC FB FF FF F7 '
    'F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 FA FA '
    'F9 F9 F9 F9 F9 F9 F9 F9 F9 FB FB FC FB FF FF FF '
    'FF F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 '
    'FA FA F9 F9 F9 F9 F9 F9 F9 F9 F9 FB FB FF FF FF '
    'FF FF FF F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 '
    'F7 F7 FA FA F9 F9 F9 F9 F9 F9 F9 F9 F9 FF FF FF '
    'FF FF FF FF FF F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 F7 '
    'F7 F7 F7 F7 FA FA F9 F9 F9 F9 F9 FF FF FF FF FF '
    'FF FF FF FF FF FF FF F7 F7 F7 F7 F7 F7 F7 F7 F7 '
    'F7 F7 F7 F7 F7 F7 FA FA F9 FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF F7 F7 F7 F7 F7 F7 F7 '
    'F7 F7 F7 F7 F7 F7 F7 FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF F7 F7 F7 F7 F7 '
    'F7 F7 F7 F7 F7 FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 F7 F7 '
    'F7 F7 F7 FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F7 '
    'F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF F9 FF FF FF E0 3F FF FF 80 1F FF FE 00 '
    '07 FF F8 00 01 FF E0 00 00 7F 80 00 00 1F 00 00 '
    '00 03 00 00 00 01 80 00 00 00 80 00 00 00 00 00 '
    '00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 '
    '00 00 00 00 00 00 80 00 00 00 E0 00 00 00 F8 00 '
    '00 01 FE 00 00 07 FF 80 00 1F FF E0 00 7F FF F8 '
    '01 FF FF FE 07 FF FF FF 9F FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 28 00 '
    '00 00 10 00 00 00 20 00 00 00 01 00 08 00 00 00 '
    '00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 '
    '00 00 00 00 00 00 FF FF FF 00 CB FE FF 00 99 FE '
    'FF 00 65 FE FF 00 33 FE FF 00 00 FD FD 00 FE CB '
    'FF 00 CB CB FF 00 99 CB FF 00 65 CB FF 00 33 CC '
    'FF 00 00 CB FD 00 FE 99 FF 00 CB 99 FF 00 99 99 '
    'FF 00 65 98 FF 00 33 98 FF 00 00 98 FD 00 FE 65 '
    'FF 00 CB 65 FF 00 98 65 FF 00 65 65 FF 00 33 65 '
    'FF 00 00 65 FD 00 FE 33 FF 00 CB 33 FF 00 98 33 '
    'FF 00 65 33 FF 00 33 33 FF 00 00 32 FD 00 FD 00 '
    'FD 00 CB 00 FD 00 98 00 FD 00 65 00 FD 00 32 00 '
    'FD 00 00 00 FD 00 FF FF CB 00 CB FF CB 00 99 FF '
    'CC 00 65 FF CB 00 33 FF CC 00 00 FD CB 00 FF CB '
    'CB 00 CC CC CC 00 98 CB CB 00 66 CB CC 00 32 CB '
    'CB 00 00 CB CC 00 FF 99 CB 00 CB 98 CB 00 98 98 '
    'CB 00 66 98 CC 00 32 98 CB 00 00 99 CC 00 FF 65 '
    'CB 00 CB 66 CC 00 98 66 CC 00 66 66 CC 00 32 65 '
    'CB 00 00 65 CC 00 FF 33 CB 00 CB 32 CB 00 98 32 '
    'CB 00 65 32 CB 00 32 32 CB 00 00 32 CC 00 FD 00 '
    'CB 00 CB 00 CC 00 98 00 CC 00 65 00 CC 00 32 00 '
    'CC 00 00 00 CC 00 FF FF 99 00 CB FF 99 00 99 FF '
    '99 00 65 FF 98 00 33 FF 99 00 00 FD 98 00 FF CC '
    '99 00 CB CB 98 00 98 CB 98 00 66 CC 99 00 32 CB '
    '98 00 00 CC 99 00 FF 99 99 00 CB 98 98 00 99 99 '
    '99 00 65 98 98 00 33 98 99 00 00 97 98 00 FF 65 '
    '98 00 CC 66 98 00 98 65 98 00 65 65 98 00 33 65 '
    '99 00 00 65 98 00 FF 33 98 00 CB 32 98 00 98 33 '
    '99 00 65 33 99 00 33 33 99 00 00 32 98 00 FD 00 '
    '98 00 CC 00 98 00 97 00 98 00 65 00 98 00 32 00 '
    '98 00 00 00 98 00 FF FF 65 00 CB FF 65 00 98 FF '
    '65 00 65 FF 65 00 33 FF 66 00 00 FD 65 00 FF CB '
    '65 00 CC CC 66 00 98 CC 66 00 66 CC 66 00 32 CB '
    '65 00 00 CC 66 00 FF 98 65 00 CC 99 66 00 98 98 '
    '65 00 65 98 65 00 33 99 66 00 00 98 65 00 FF 65 '
    '65 00 CC 66 66 00 98 65 65 00 66 66 66 00 32 65 '
    '65 00 00 65 66 00 FF 33 65 00 CB 32 65 00 99 33 '
    '65 00 65 32 65 00 32 32 65 00 00 32 66 00 FD 00 '
    '65 00 CC 00 65 00 98 00 65 00 65 00 66 00 32 00 '
    '66 00 00 00 66 00 FF FF 33 00 CC FF 33 00 98 FF '
    '33 00 66 FF 33 00 33 FF 33 00 00 FD 32 00 FF CC '
    '33 00 CB CB 32 00 98 CB 32 00 65 CB 32 00 32 CB '
    '32 00 00 CC 33 00 FF 99 33 00 CB 98 32 00 99 99 '
    '33 00 65 99 33 00 33 99 33 00 00 98 32 00 FF 66 '
    '33 00 CB 65 32 00 99 66 33 00 65 65 32 00 32 65 '
    '32 00 00 66 33 00 FF 33 33 00 CB 32 32 00 99 33 '
    '33 00 65 32 32 00 33 33 33 00 00 31 32 00 FD 00 '
    '32 00 CC 00 32 00 98 00 32 00 66 00 32 00 31 00 '
    '32 00 00 00 32 00 FD FD 00 00 CB FD 00 00 98 FD '
    '00 00 65 FD 00 00 32 FD 00 00 00 FD 00 00 FD CB '
    '00 00 CC CC 00 00 99 CC 00 00 65 CC 00 00 33 CC '
    '00 00 00 CC 00 00 FD 98 00 00 CC 99 00 00 98 98 '
    '00 00 65 98 00 00 32 98 00 00 00 98 00 00 FD 65 '
    '00 00 CC 66 00 00 98 65 00 00 66 66 00 00 32 66 '
    '00 00 00 66 00 00 FD 32 00 00 CC 33 00 00 98 32 '
    '00 00 66 33 00 00 32 32 00 00 00 32 00 00 FD 00 '
    '00 00 CC 00 00 00 98 00 00 00 66 00 00 00 32 00 '
    '00 00 00 00 EE 00 00 00 DC 00 00 00 BA 00 00 00 '
    'AA 00 00 00 88 00 00 00 76 00 00 00 54 00 00 00 '
    '44 00 00 00 22 00 00 00 10 00 00 EE 00 00 00 DC '
    '00 00 00 BA 00 00 00 AA 00 00 00 88 00 00 00 76 '
    '00 00 00 54 00 00 00 44 00 00 00 22 00 00 00 10 '
    '00 00 EE 00 00 00 DC 00 00 00 BA 00 00 00 AA 00 '
    '00 00 88 00 00 00 76 00 00 00 54 00 00 00 44 00 '
    '00 00 22 00 00 00 10 00 00 00 EE EE EE 00 DD DD '
    'DD 00 BB BB BB 00 AA AA AA 00 88 88 88 00 77 77 '
    '77 00 55 55 55 00 44 44 44 00 22 22 22 00 11 11 '
    '11 00 00 00 00 00 FF FF FF FF FF FF FA FA FF FF '
    'FF FF FF FF FF FF FF FF FF FF FA FA FA FA FA FA '
    'FF FF FF FF FF FF FF FF FA FA FA FA FF FF FA FA '
    'FA FA FF FF FF FF FA FA FA FA FF FF FF FF FF FF '
    'FA FA FA FA FF FF FF FA FF FF FF FA D8 FB FC FF '
    'FF FF FA FA FA FA FF FF FF FA FB FA F9 FB FC FC '
    'FC FF FF FF FA FF FF F9 FB FB FB FA F9 F9 FB FC '
    'FC FC FC FF FF FF FF FB FB F8 F7 FA FA F9 F9 F9 '
    'FB FB FC FC FC FF FF F7 F7 F7 F7 F7 F7 FA FA F9 '
    'F9 F9 FB FC FC FF FF FF FF F7 F7 F7 F7 F7 F7 FA '
    'FA F9 F9 F9 FB FF FF FF FF FF FF F7 F7 F7 F7 F7 '
    'F7 FA FA FF FF FF FF FF FF FF FF FF FF F7 F7 F7 '
    'F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF '
    'FF FF FF FF FF FF FC FF FF FF F0 3F FF FF C0 0F '
    'FF FF 00 03 FF FF 80 00 FF FF 00 01 FF FF 00 00 '
    'FF FF 00 00 FF FF 00 00 FF FF 00 00 FF FF C0 00 '
    'FF FF F0 03 FF FF FC 0F FF FF FF 3F FF FF FF FF '
    'FF FF FF FF FF FF '
    END

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    What does the parse error say? Have you declared IDI_MYICON?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    4
    Well the parse error is:

    Line 150 in file resource.rc: parse error

    also I have declared IDI_MYICON as:

    #define IDI_MYICON 101

    in the resource.h file

    -geoff

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,648
    Post it so others can try to compile it.

    gg

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    4
    Do you mean you want me to post the resource.h data?

    #define IDI_MYICON 101

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting out a resource manager
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 11-10-2008, 06:12 PM
  2. unmanaged resource
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2008, 03:23 AM
  3. CreateProcess with Resource of executable, not the Filename
    By Ktulu in forum Windows Programming
    Replies: 4
    Last Post: 11-04-2006, 12:07 AM
  4. resource problem/question
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 01-29-2003, 01:08 PM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 09:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21