By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,470 Members | 1,907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,470 IT Pros & Developers. It's quick & easy.

store icons in a dll

P: n/a
Tal
Hi,

i'm looking for a source code in java (or VB) that will get .ico
files and store them in a .dll resorce file.
sonthing like the ICONDLL.EXE program.

10x,
Tal.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> i'm looking for a source code in java (or VB) that will get .ico
files and store them in a .dll resorce file.
sonthing like the ICONDLL.EXE program.


Here is some VB.NET code that generates a resource:

Dim rw As New ResourceWriter("Flags.resources")

Dim strFile As String
Dim strInconName As String
Dim img As Image

For Each strFile In Directory.GetFiles("C:\Program Files\Microsoft
Visual Studio .NET\Common7\Graphics\icons\Flags", "*.ico")
strIconName = strFile.Substring(strFile.Length - 7, 3)
img = Image.FromFile(strFile)
rw.AddResource(strIconName, img)
Next

rw.Close()

Then you can generate a dll with the Assembly Linker tool:
al /embed:Flags.resources /out:Flags.resources.dll

That is it!

:-)
Anders Lybecker
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.