473,326 Members | 2,012 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,326 software developers and data experts.

Embedded resources

Nak
Hi there,

I'm having a little confusion with embedding resources into my VB.NET
app. In VB6 I could make a resource file that could hold icons, these icons
could then be used for file association, how the hell do you do that with
VB.NET? It seems to me that I need to have a copy of the ICO file in the
applications install folder, which seems like a bit of a bodge to me, surely
I must be able to embed lots of icons into my application that could then be
used in the setup program when adding file types. I have tried adding icons
and setting them to "embedded resource" but upon trying to change the icon
in the file types it only shows the main program icon. Surely I must be
doing this all wrong, also, what is the deal with an assembley resource
file? I don't seem to be able to add icons to these, only text. Thanks in
advance, any enlightenment into this would be great, and if anyone knows how
I could also have nice Windows XP colour depth icons in my app I would be
very greatful also.

Nick.
Nov 19 '05 #1
2 5749
Nak
Herfried,

Thanks for the information, I'm slightly suprised that this isn't
supported, but then again maybe I'm not. Maybe I should just refer to icons
in the application directory instead just for convenience, less chance of me
messing something up then. I've downloaded your example, thanks loads for
your help.

Nick.

"Herfried K. Wagner" <aon.912666908.N.O.S.P.@.M.aon.at> wrote in message
news:O%****************@TK2MSFTNGP10.phx.gbl...
Hello,

"Nak" <a@a.com> schrieb:
VB.NET? It seems to me that I need to have a copy of the
ICO file in the applications install folder, which seems like a bit
of a bodge to me, surely I must be able to embed lots of icons
into my application that could then be used in the setup program
when adding file types.
AFAIK this is not supported by VS .NET.

The icons must be included as Win32 resource:

http://www.mvps.org/dotnet/dotnet/sa...dingtechnique/
-> sample "ResourceIcons"

-- or --

You can embed the icons by using the UpdateResource Win32 function (see
MSDN; this would require that you build a tool that embeds the icons in

the compiled executable).

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Nov 19 '05 #2
The resources you are referring to are 'Win32 Resources' i.e. unmanaged.
Managed resources are easier to use in some cases, but of course, Windows
wasn't written in managed C++, so they aren't really supported as standard
icons :-)

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

" There's no place like 127.0.0.1 "

Please respond to the newsgroup,
so all can benefit.
One Day,
"Nak" <a@a.com> wrote in message
news:OH*************@TK2MSFTNGP10.phx.gbl...
Herfried,

Thanks for the information, I'm slightly suprised that this isn't
supported, but then again maybe I'm not. Maybe I should just refer to icons in the application directory instead just for convenience, less chance of me messing something up then. I've downloaded your example, thanks loads for
your help.

Nick.

"Herfried K. Wagner" <aon.912666908.N.O.S.P.@.M.aon.at> wrote in message
news:O%****************@TK2MSFTNGP10.phx.gbl...
Hello,

"Nak" <a@a.com> schrieb:
VB.NET? It seems to me that I need to have a copy of the
ICO file in the applications install folder, which seems like a bit
of a bodge to me, surely I must be able to embed lots of icons
into my application that could then be used in the setup program
when adding file types.


AFAIK this is not supported by VS .NET.

The icons must be included as Win32 resource:

http://www.mvps.org/dotnet/dotnet/sa...dingtechnique/
-> sample "ResourceIcons"

-- or --

You can embed the icons by using the UpdateResource Win32 function (see
MSDN; this would require that you build a tool that embeds the icons in

the
compiled executable).

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


Nov 19 '05 #3

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

Similar topics

0
by: Philipp Seidel | last post by:
Hi there! I did not know, where this topic fits in, so I put it here. I have a minor problem with embedded resources, which puzzles me quite a lot. I'd be glad if anyone can help me on this: ...
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
0
by: Chris Schremser | last post by:
I have a question regarding embedded controls in IE. We are looking to replace a small VB ActiveX control with something written in C#. We have written the control and it instantiates correctly...
2
by: Kyle Kaitan | last post by:
I have an assembly (AppResources.dll) which contains a number of embedded resource files. Most of these are key/value pairs of relevant strings; a few are images and sounds; some more are XML...
7
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
4
by: Jon Rista | last post by:
I have a project where I need to create a windows .exe by compiling code and linking in some resources. This program thats being generated is somewhat unconventional, and I'll explain how. I'm...
0
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
4
by: Bob Rock | last post by:
Hello, I'd like to programmatically access keys and values of on .resources file embedded in my assembly. I've seen that the assembly class provides the GetManifestResourceStream method .......
8
by: Fred* | last post by:
Hello, I'm using Visual C# 2005 Express. if I create a new "application windows" project and run it (F5), it works well. (an empty window is launched..) as soon as I set the build action to...
2
Frinavale
by: Frinavale | last post by:
I am attempting to use embedded resources in an Ajax Enabled ASP.NET Web Application. I'm using Visual Studio 2008 and VB.NET server side code. The project is called "EmbeddedResources" with the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.