Okay, first, you wouldn't add the *.rc to your *.cpp. In Dev C++. simply right clikc on your project in the dropdown list and selsct add to Project. Then add your *.rc. Then yes, you would make your resource.h and add it to your project and your *.rc.
As to your second question, I'll walk you through the making of a basic resource.
Always start out with windows.h and your definition of IDC_STATIC.
Code:
#include <windows.h>
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
You could go into winuser.h and find the part of the code that defines IDC_STATIC and remove it from the if statement that keeps it from being defined. But unless you really
know what you're doing, you shouldn't mess with standard headers.
Now, here's a basic menu resource.
Code:
#include <windows.h>
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
IDM_MENU MENU DISCARDABLE
BEGIN
POPUP "&Test"
BEGIN
MENUITEM "&Click This", IDM_TEST_CLICKTHIS
END
END
Now that we've got the resource written, we need a header with definitions.
Code:
#ifndef RESOURCE_H /*Not really necessary, but is good practice with headers.*/
#define RESOURCE_H /*Same as above.*/
#define IDM_MENU 0x1000
#define IDM_TEST_CLICKTHIS 0x1011
#endif
And, simply include them innyour source and your resource.
Code:
#include <windows.h>
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
#include "resource.h"
IDM_MENU MENU DISCARDABLE
BEGIN
POPUP "&Test"
BEGIN
MENUITEM "&Click This", IDM_TEST_CLICKTHIS
END
END
If you still get errors with that code, (assuming I didn't mess up ), then you've got real problems. If you still get errors on the #include "resource.h" line the you may have mispalced the file and it's not in your main directory.
If you still get a syntax error, then it could be a number of things. Have you ever actually opened up the windows.h file or any other headers? If so you might have accidentally made some minute change that's messing up your whole code.
For that menu, you shound't even need windows.h in your resource so you could try removing it. If that gets rid of your rescource errors, then there's a problem with the header itself. You could try reinstalling Dev C++ entirely.