Hello, dear guys,
I met another curious issue of finding the resources.
There was a dynamic file, which include a resource:
/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//
IDR_FX_CLASSICMATERIAL RCDATA "..\\Shaders\
\ClassicMaterial.fx"
And, the app could load the dll, and working fine.
But, I convert it into the the static lib, then it broken down. I
check the code in the library, the error was in FindResource function:
HRSRC hResource = ::FindResource(gModule,
MAKEINTRESOURCE(IDR_FX_CLASSICMATERIAL), RT_RCDATA);
The return value was zero. I don't know why this happen if it's static
library.
The error message was : "The speicified type cannot be found in the
image file"
I first guest maybe it's HINSTANCE fault, but when I add the header
IMAGE_DOS_HEADER, it still the same fault.
Have you met this issue before?
Ed - 27 Jun 2007 09:44 GMT
> Hello, dear guys,
> I met another curious issue of finding the resources.
[quoted text clipped - 22 lines]
> IMAGE_DOS_HEADER, it still the same fault.
> Have you met this issue before?
And this module do not use MGC dll, so AfxFindResourceHandle can not
be used here.
David Lowndes - 27 Jun 2007 09:45 GMT
>There was a dynamic file, which include a resource:
>/////////////////////////////////////////////////////////////////////////////
[quoted text clipped - 15 lines]
>The error message was : "The speicified type cannot be found in the
>image file"
The problem is that a static library can't contain any resources.
Unfortunately the tools don't do anything to tell you that, so it's
easy to assume you ought to be able to do it. :(
Dave