473,803 Members | 3,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can not find the resource

Hello, dear guys,
I met another curious issue of finding the resources.

There was a dynamic file, which include a resource:
/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//

IDR_FX_CLASSICM ATERIAL RCDATA "..\\Shader s\
\ClassicMateria l.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_CLASSIC MATERIAL), 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_HEADE R, it still the same fault.
Have you met this issue before?

Jun 27 '07 #1
5 1859
Ed
On Jun 27, 4:45 pm, David Lowndes <Dav...@example .invalidwrote:
There was a dynamic file, which include a resource:
/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//
IDR_FX_CLASSICM ATERIAL RCDATA "..\\Shader s\
\ClassicMateria l.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_CLASSIC MATERIAL), 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"

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
Is there something workaround to make static library contain the
resources?
And it seems there are many restrict of the conversion from dynamic
lib to static lib in MS.

Jun 27 '07 #2
>There was a dynamic file, which include a resource:
>/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//

IDR_FX_CLASSIC MATERIAL RCDATA "..\\Shader s\
\ClassicMateri al.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_CLASSIC MATERIAL), 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"
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
Jun 27 '07 #3
Ed
On Jun 27, 2:53 pm, sealo <seah...@gmail. comwrote:
Hello, dear guys,
I met another curious issue of finding the resources.

There was a dynamic file, which include a resource:
/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//

IDR_FX_CLASSICM ATERIAL RCDATA "..\\Shader s\
\ClassicMateria l.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_CLASSIC MATERIAL), 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_HEADE R, it still the same fault.
Have you met this issue before?
And this module do not use MGC dll, so AfxFindResource Handle can not
be used here.

Jun 27 '07 #4
>Is there something workaround to make static library contain the
>resources?
No, they can't if they're resources. You'd have to arrange to separate
out the resources and include them more directly into the project
you're linking your static library to. Alternatively, include them as
data in the code.

Dave
Jun 27 '07 #5

"Ed" <se*****@gmail. comwrote in message
news:11******** **************@ o11g2000prd.goo glegroups.com.. .
On Jun 27, 4:45 pm, David Lowndes <Dav...@example .invalidwrote:
>There was a dynamic file, which include a resource:
/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//
>IDR_FX_CLASSIC MATERIAL RCDATA "..\\Shader s\
\ClassicMateri al.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_CLASSIC MATERIAL), 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"

The problem is that a static library can't contain any resources.
Unfortunatel y 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

Is there something workaround to make static library contain the
resources?
A compiled resource, aka .res file, does for resources what a .lib does for
code. You'll have to distribute both.
And it seems there are many restrict of the conversion from dynamic
lib to static lib in MS.

Jun 27 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
35715
by: Faz | last post by:
I am trying to extract text before a certain character appears in a string. This character is the letter "C". Here is some sample data - the field is called REFERENCE_2: REFERENCE_2 10299C17264 9841C17218 I want to extract 10299 for the first line and 9841 for the second
8
5503
by: jquest | last post by:
Hi Again; I have had help from this group before and want to thank everyone, especially PCDatasheet. My database includes a field called HomePhone, it uses the (xxx)xxx-xxx format to include area code. When a customer calls, I currently use Ctrl F with the HomePhone field highlighted. Then I enter the last 4 digits and use the find next option. This is cumbersome, so I have tried several methods (including a macro) using comand...
3
16039
by: Craig | last post by:
Hi I'm creating a web control whereby I use a resource file to store strings for property descriptions and so forth. The namespace for the control is: Unsd.Web.WebControls all classes in the control use this namespace. The assembly file name is Unsd.Web.WebControls.Banner.dll and the resource file name which resides in the same directory as the class files is Unsd.Web.WebControls.resources (Build Action=Embedded Resource) The...
2
1085
by: Booster | last post by:
Hi I am a beginner working with VB.net Ho to: find data in another column using the index number "ParamID", also the possibility to updata the data in "ParamVal". This is a Parameter table "tblParameter" in an access BE-database
34
2990
by: priyanka | last post by:
Hi, I was wondering if we could parse or do something in the executable( whose source language was C). How can I use some scripting language like perl/python to find out the information about the executable ? Is it possible ? Also, how does the compiler add inling to the program ? I know that whenever it sees"inline" in front of the procedure name, it inlines it. But if we give the -finline options, it inline all the procedures ? How
0
2423
by: klemen.verdnik | last post by:
Hi... I'm having some difficulties getting all possible keys from a specific resource class. Let's say I have a file named: MyProj.TranslationStrings.resx in my App_GlobalResources folder And let's say the .resx file contains two entries: "status.0" with value "Disabled" "status.1" with value "Enabled"
13
1899
by: Carl Johansson | last post by:
Being quite new to C#, I may have misunderstood this. If so please bear with me! As far as I can understand, any instances of a class that implements the IDisposable interface must call the Dispose method not create leaks of resources!? This can be accomplished by explicitly calling Dispose or through the "using" statement. For example, a recursive method that creates hundreds or thousands of instances of, for example,...
12
5279
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
2
1947
by: Jasper | last post by:
I'm stuck using a library based on old style classes, and need to find a class's parent at runtime. With new style classes you can use .__base__ to inspect a parent, but I can't remember how this was done in days of yore, before object. I've tried googling, but apparently my search term Fu is weak. :-( Can anyone help me out here? There must be something simple. -Jasper
2
8728
by: steve | last post by:
I have the following routine for retrieving error message strigs from a resource file which is embedded in the project. But when it is called I get the error messsage "Could not find any resources.." shown underneath the code. The error message indicates that it is looking for resource ResourceExceptions.resource which is not what was embedded in the code by Visual Studio. The resource file is ResourceExceptions.resx. If I try to change...
0
9565
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.