Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2007

Tip: Looking for answers? Try searching our database.

Can not find the resource

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sealo - 27 Jun 2007 07:53 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.