I have been posting on the gpwiki website for an answer to my question yet no body has replied. So I'm bringing my question here. Once upon a time, I bought a wonderfull book called game programming in 24 hours. This seemed a good book until I got up to the bit where it asked me to create a resource file. I then was forced to leave this book and migrate to other things. i tried my hand at SDL, VB and even Python before deciding to try and learn the Windows API. This was again doing fine until I stumbled upon the resource problem again. I could not proceed any further through this tutorial without knowing how to create a resource file and it seemed that no body on the net knew how to either! There were approximately 0 tutorials involving creating resources in Visual Studio on the net, so I posted on various message boards but no one could help. This is what I though was the way to do it:
Whilst creating the window class I wanted to load an icon from a resource file so I created a resource file which created its own little header file named resource.h. This had the file ID's in it and some mumbo jumbo which looked like this:
Code:
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
This was considerably confusing. I then imported my icon into the resource file and compiled it. Then I used the ID in my code:
Code:
wc.hIconSm = LoadIcon( NULL, IDI_ICON1 );
I also tried:
Code:
wc.hIconSm = LoadIcon( NULL, "IDI_ICON1 );
Both of these times the project was built and ran perfectly fine without any errors but there was no change to the default icon in the top left of the window. I tried this with other ersources but it still compiled but did not work. What am I doing wrong! Can someone please help!