Hi, I'm doing a simple program with a resource.
I start new project...add a resource file with this:
101 RCData "empty.txt"
Then in main.c I put:
Resource = FindResource(NULL, MAKEINTRESOURCE(101), RT_RCDATA);
if(Resource == NULL) printf("Error loading resource");
And this don't work, it show the error message. But the code is ok, isn't?
Then I've changed the code to: __
Resource = FindResource(NULL, MAKEINTRESOURCE(101), "RCDATA");
if(Resource == NULL) printf("Error loading resource");
This work good.
I believe that this is a problem of the "resource compiler", when you compile the project and see the executable file with a resource editor, you can see that the name is "RCDATA" uppercase and another compilers name the resource directory with "RCData".
I've try change the name of the resource RCDATA to RCData and then the first code work good.
Is it a problem? or I'm doing something bad.
Regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try to create a header file with 1 line: #define RCDATA 101
Or if that doesn't work you might be able to use: #define ID_RCDATA 101
Also, make sure you're including the header file windows.h in your C source file.
Oh, and make sure the file "empty.txt" is in the same folder as your program.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm doing a simple program with a resource.
I start new project...add a resource file with this:
101 RCData "empty.txt"
Then in main.c I put:
Resource = FindResource(NULL, MAKEINTRESOURCE(101), RT_RCDATA);
if(Resource == NULL) printf("Error loading resource");
And this don't work, it show the error message. But the code is ok, isn't?
Then I've changed the code to: __
Resource = FindResource(NULL, MAKEINTRESOURCE(101), "RCDATA");
if(Resource == NULL) printf("Error loading resource");
This work good.
I believe that this is a problem of the "resource compiler", when you compile the project and see the executable file with a resource editor, you can see that the name is "RCDATA" uppercase and another compilers name the resource directory with "RCData".
I've try change the name of the resource RCDATA to RCData and then the first code work good.
Is it a problem? or I'm doing something bad.
Regards.
Try to create a header file with 1 line: #define RCDATA 101
Or if that doesn't work you might be able to use: #define ID_RCDATA 101
Also, make sure you're including the header file windows.h in your C source file.
Oh, and make sure the file "empty.txt" is in the same folder as your program.