View Single Post
Old 12-11-2004, 03:23 PM   #1 (permalink)
harker
Registered User
 
Join Date: Dec 2004
Posts: 4
harker is on a distinguished road
Newbie, can't not work out what's wrong with this code

Hi there,

I have a main piece of code that inlucdes a resource file.

I have followed the tutorials, and tried to make my way from there.

I keep getting a compile error saying that a constant 'ICON_GROUP', define in 'resources.h', is not defined. This is a win32 application by the way.

Here is my resources.h file

Code:
#define ICON_GROUP 1002
#define ICON_LEAF 1003
#define ICON_DL 1004
#define ICON_RIP 1005
#define MY_TREE 1000
#define MAIN_WINDOW 1001
here is my resources.rc file
Code:
#include "resources.h"

ICON_GROUP ICON "./resources/collection.ico"
ICON_LEAF ICON "./resources/treble.ico"
ICON_RIP ICON "./resources/rip.ico"
ICON_DL ICON "./resources/download.ico"
this is the code snippet that contains the erroneous code

Code:
#include <windows.h>
#include <commctrl.h>
#include "resources.h"
#include "MyWinTree.h"

.....


if ((himl = ImageList_Create(16, 
                                 16,
                                 FALSE, 
                                 4, 0)) == NULL) 
        return NULL; 

    // Add the open file, closed file, and document bitmaps. 
    hbmp = LoadBitmap(tree.group(), MAKEINTRESOURCE(ICON_GROUP)); 
    g_nOpen = ImageList_Add(himl, hbmp, (HBITMAP)NULL); 
    DeleteObject(hbmp); 
...
Additional info: the MyWinTree.h file contains a class declaration for a wrapper to a windows Tree_View. It also includes 'resources.h'

I am using Bloodshed Dev-C++ to compile with.

Any help would be appreciated

I am a java programmer trying to make add C++ to his belt

Regards

Steve
harker is offline   Reply With Quote