473,831 Members | 2,250 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 5294
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
1652
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
26820
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
3158
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
2779
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
1967
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
2339
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
21665
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
9642
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
10493
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10526
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
10206
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9315
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
7747
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
6951
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();...
2
3960
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
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.