|
-
May 10th, 2011, 04:44 AM
#1
Embedding and loading custom resource file (jpeg) in the project
Hello,
I am working on a Visual Studio 2008 project and have been experiencing some troubles with custom (jpg) resource files. So far I have managed to add the resource into my project. I can see "IDR_JPEG1" correctly in the resource view. However, I have no idea how I can load and use that resource file in my code.
After some googling I figured out that I maybe I should use loadResource and findResource methods. I tried with the following piece of code:
HRSRC res = FindResource(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_JPEG1),"JPEG");
GLOBAL mem = LoadResource(GetModuleHandle(NULL), res);
void *data = LockResource(mem);
But during compiling I receive undeclared identifier errors:
error C2065: 'HRSRC' : undeclared identifier
error C2065: 'IDR_JPEG1' : undeclared identifier
error C3861: 'FindResource': identifier not found
And so on...
How can I load the jpg file and use it in my code? All the help is appreciated. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|