Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > !!HELP with res...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4220 of 4370
Post > Topic >>

!!HELP with resource script

by Ben <noemail@[EMAIL PROTECTED] > Jul 27, 2008 at 06:29 PM

I added the resource script (RC file= to the DEV C++ Project files.
The project compiles OK, but FindResource cannot find the resource.
The resource file is OK, the resource type is IMA and the resource name is

IMA_1. (DEV C++ 5, W Vista Home Ed)

I guess the resource script is not getting compiled at all.
I would prefer to add a .RES file to the Dev C++ Project.
How can do that?

Thanks in advance.

#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char *argv[])
{
 HRSRC   hRsrc;
 HGLOBAL hResource;
 DWORD   dwSize;
 int   hfFile;
 
 hRsrc = FindResource(NULL, TEXT("IMA_1"),TEXT("IMA"));

 if (hRsrc) 
 {
     hResource = LoadResource(NULL, hRsrc);
     dwSize = SizeofResource(NULL, hRsrc);
    
     char *pdata = (char *)LockResource(hResource);
     
     hfFile = _lopen("image.jpg",OF_WRITE);
     _lwrite(hfFile, pdata, dwSize);
     _lclose(hfFile);
 }
 else
   cout << "Failure";
	
  return 0;
}
 




 2 Posts in Topic:
!!HELP with resource script
Ben <noemail@[EMAIL PR  2008-07-27 18:29:29 
Re: !!HELP with resource script
Stuart Golodetz <sgolo  2008-07-28 00:59:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 16:39:01 CST 2008.