473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

GetEmbedded Resource from Derived class

Hi,

I have a base class that's compiled in an assembly.
public class mybase
{
public void mymethod()
{
//can i get the embeded resources?
//Stream st =
assembly.GetCallingAssembly.GetManifestResourceStr eam("ResourceName");
}
}

I create another project, added a class derived from the mybase
public class myderived : mybase
{

}
and I have an embedded resource in this assembly.

My question is how (is it possible) to get the embedded resource in the
derived class assembly from the mymethod() in the base class?

Thanks very much!

John
Nov 15 '05 #1
3 1567
Use ResourceManager to retrieve the resources for the required type

HTH
fbhah
Nov 15 '05 #2

Hi John,

Thank you for posting in the community!

Based on my understanding, you use
assembly.GetCallingAssembly.GetManifestResourceStr eam to get the resource
in a parent class in an assembly, then you derive from this class and
calling mymethod(Which is overrided from parent class) in the child class,
you want to know if this is possible.

===============================================
In your code, you invoke Assembly.GetCallingAssembly which will return the
Assembly of the method that invoked the currently executing method.
So althrough mymethod is overrided from parent class,
Assembly.GetCallingAssembly will return the child class's assembly.

Then, GetManifestResourceStream will retrieve the child assembly's
resource. So your code should work as you expected.

Addtionally, for more information about how to deal with Resource in
VS.net, please refer to:
http://msdn.microsoft.com/library/de...us/dnforms/htm
l/winforms02202003.asp

===============================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

Hi John,

Is your problem resolved?

If you still have anything unclear, please feel free to tell me, I will
help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #4

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

Similar topics

3
by: Danny Pressley | last post by:
Hey All, After a doc/view/frame is created and initialized, is there a way from within the frame class code (CMyChildFrame::OnUpdateFrameMenu()) to get the resource ID (nIDResource =...
1
by: Scott Smith | last post by:
Several attributes and interface methods I'm using refer to resources (such as strings or icons) by a numeric ID. This was the only way to refer to resources in unmanaged code (C++, for example),...
2
by: David Muoio | last post by:
I am trying to validate an XML file against an XSD that is stored in the assembly as an embedded resource. I can get it to work as long as the XSD does not include other XSDs. After a fair amount...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
8
by: Frédéric Mayot | last post by:
Hi, I'm trying to embed a js file in my class library and register it in an aspx. I created the most simple solution I could : + ClassLibrary1 : - Class1.cs - test.js (embedded resource)...
1
by: D Witherspoon | last post by:
Coming up with a scenario here. For example there is the standard .NET MailMessage class. I am creating a project (let's call it CommonBase) that has the following 2 classes ...
1
by: ramhog | last post by:
I have an abstract class "TestClass" in a project. In the project there are several icon files that are set to be an embedded resource. In the abstract class is a private method attempting to...
61
by: Sanders Kaufman | last post by:
I'm wondering if I'm doing this right, as far as using another class object as a PHP class property. class my_baseclass { var $Database; var $ErrorMessage; var $TableName; var $RecordSet;...
2
by: vlbel | last post by:
I'm trying to do the following: 1) The main program consists of ------------ a.h ------------ class A { public: virtual ~A(){} virtual void b(); };
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.