Getting a resource

Hey Guys ...
I am trying to include a resource to my program but unfortunately I couldn't
here is the code...


1
2
3
4
5
6
hRsrc = FindResource(NULL, MAKEINTRESOURCE(IDR_STUB), "STUB");
    if(hRsrc == NULL)
    {
   error("Error Could not find resource");

    }


This conditional if is always true .... at the the beginning of the code I defined #define IDR_STUB 1
and at the same Directory of the project I have the file stub.exe and I have this file to include it

project.rc and inside this file there is

1
2
3
#define IDR_STUB 1

IDR_STUB STUB DISCARDABLE "stub.exe"




so what is the problem ?

MSDN writes:
hModule [in, optional]
Type: HMODULE

A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is NULL, the function searches the module used to create the current process.

http://msdn.microsoft.com/en-us/library/ms648042(VS.85).aspx

You appear to be using the "FindResource()" function wrong.
So could u explain to me how can I use it .. because I couldn't understand what is written in Microsoft website I mean I couldn't totally get it .. could u help me ?
any help ??
Topic archived. No new replies allowed.