473,943 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetManifestReso urceStream stream question

I'm reading embedded bitmaps from an EXE project and everthing works fine. I
do a GetExecutingAss embly, followed by setting a stream object to
MyAssemblyName. GetManifestReso urceStream("MyA pp.MyBitmap.BMP "). Note that
the BMP is set as an embedded resource via it's properties in the VB.NET
project. Finally, I do a "New Bitmap(MyStream )" to fetch the resource into a
Bitmap object and job done - I can display it in a PictureBox.

However, when I add the same bmp into a DLL (ie: a Class Library project)
instead of an EXE project, it doesn't work. When I set the stream object to
MyAssemblyName. GetManifestReso urceStream("MyD llName.MyBitmap .BMP") the
stream is returned as "nothing". I'm sure my embedded resource path is
correct because I use "ILDASM.EXE " to check out the DLL assemblies manifest,
and the path shows as public mydllname.MyBit map.BMP.

So what am I doing wrong? Is it not permitted to read embedded resources
from a DLL? Or am I missing a step when dealing with DLL's? All I get is an
exception loading the bitmap because the stream is "nothing".

Thanks for help,

Tom Edelbrok
Nov 21 '05 #1
1 5303
Figured it out!

When you have an EXE project open simultaneous with a DLL (Class Library)
project VB.NET will permit you to flip back and forth between the two very
easily. You can even make changes in the DLL code while in the EXE project
and do debugging.

BUT DON'T!!!

Because the code changes you make don't always apply. To be certain that
they are applied you must always go back to the DLL project, rebuild it,
then go back to your EXE project and run.

Therefore the coding changes I made to fix my Embedded Resource problem
weren't being applied. In fact, my coding changes were correct but I didn't
know it.

Tom

"Tom Edelbrok" <an*******@anon ymous.com> wrote in message
news:htebe.13$v N2.7@clgrps13.. .
I'm reading embedded bitmaps from an EXE project and everthing works fine.
I do a GetExecutingAss embly, followed by setting a stream object to
MyAssemblyName. GetManifestReso urceStream("MyA pp.MyBitmap.BMP "). Note that
the BMP is set as an embedded resource via it's properties in the VB.NET
project. Finally, I do a "New Bitmap(MyStream )" to fetch the resource into
a Bitmap object and job done - I can display it in a PictureBox.

However, when I add the same bmp into a DLL (ie: a Class Library project)
instead of an EXE project, it doesn't work. When I set the stream object
to MyAssemblyName. GetManifestReso urceStream("MyD llName.MyBitmap .BMP") the
stream is returned as "nothing". I'm sure my embedded resource path is
correct because I use "ILDASM.EXE " to check out the DLL assemblies
manifest, and the path shows as public mydllname.MyBit map.BMP.

So what am I doing wrong? Is it not permitted to read embedded resources
from a DLL? Or am I missing a step when dealing with DLL's? All I get is
an exception loading the bitmap because the stream is "nothing".

Thanks for help,

Tom Edelbrok

Nov 21 '05 #2

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

Similar topics

0
508
by: Steve Guidi | last post by:
Hello, I'm developing an application that periodically reads embedded assembly resources. The resources are text-based, and are about 3-7KB in size, and the application accesses them by calling the Assembly.GetManifestResourceStream() method. During a long period of execution, I've noticed that the memory usage of the application increases; specifically, it appears that the System.IO.__UnmanagedMemoryStream returned by
1
660
by: Mark Rae | last post by:
Hi, I'm writing a WinForms app in C# which requires a 3rd party executable called htmldoc.exe in order to create PDF documents from HTML files. To prevent the app from not functioning if the user accidentally deletes this file, I'm investigating the possibility of making it an Embedded Resource. When the app starts up, it will search for the executable and "extract" it if it's missing. I found the following code on the Net: using...
0
1656
by: Darryn Ross | last post by:
Hi, I am trying to use GetManifestResourceStream and i keep getting a NULL exception error?? i cannot understand why? private Bitmap _buttonFace; .. ..
4
26831
by: TT (Tom Tempelaere) | last post by:
Hey there, I need a string stream, but I can't find one in .NET. I thought StringWriter would derive from Stream, alas it doesn't do so. Which leads me to my next question: What is the purpose of System.IO.StringWriter (or, what is its added value)??? It can do the same things with StringBuilder, and I see no added value. The reason why I need the string stream, is that I have a library that knows
7
3166
by: simonrigby_uk | last post by:
Hi all, Sorry if this is the incorrect group but I couldn't see anything directly relevant. Can someone confirm for me what happens when two network streams are sent to an application at the same time. My scenario is a small server application that listens on a particular TCP port. I am sending streams of data to it via a client app. Inside
2
2785
by: Jonathan Crawford | last post by:
Hi I downloaded a sample from here http://64.78.52.104/FAQ/WinForms/default.asp#44 5.57 How do I display a column of buttons such as pushbuttons or combobox buttons? I can run the project ok and it works as intended but can't get the functionality to work with my project.
1
1981
by: WT | last post by:
Hello, My 1.1 web site was using GetManifestResourceStream to get strategic .js files embedded as resources in the site assembly, but now it is no more allowed to embed resources by specifying a build process of embedding. ,Now we have the App_GlobalResources so how to use code like this with it : Stream st = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceID);
4
2345
by: Scott F. Brown | last post by:
Greetings all... I was playing around with compressing streams and came across a behavior that I do not understand. I create a stream (input) from the contents of a textbox. That stream is compressed into another stream (output). I then copy the stream (output) to another stream (input2). The compressed stream (input2) is then decompressed into a final stream (output2). My question is this. I create input2 from output.GetBuffer()...
6
21680
by: CSharpProgrammer | last post by:
Hi, I followed an example that loads an embedded resource http://support.microsoft.com/kb/324567 That works just fine and dandy. My problem is that my namespaces are setup a bit differently. I tried using both namespaces and neither seem to work. I'm assuming it shoud be the First_namespace, since that is the project namespace.
0
10136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11535
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
11299
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
9865
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
8220
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
7390
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();...
0
6088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6309
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4911
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

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.