I am working on a project in Code:Blocks c++ win32. I have read on the internet the use of LoadIcon and MAKEINTRESOURCE. However, it seems I am not using them correctly. I have created an image with paint and named it 'ico1'. It is in the format '.png'.
When I execute the program I get an error code at line 1 "error: request for member 'png' in '1002', which is of non-class type 'int'."
Below is the code.
wincl.hIcon = LoadIcon (ico1.png, MAKEINTRESOURCE(IDI_ico1));
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH) COLOR_HIGHLIGHTTEXT;
What should I do next? Any help is much appreciated. Thanks.
What I have tried:
#define IDI_ico1 1001
#define ico1 1002
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (ico1.png, MAKEINTRESOURCE(IDI_ico1));
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default colour as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_HIGHLIGHTTEXT;