dll resource file
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Hi, how do i create a dll to which it holds all the program images so my main program will load the images from a dll to the main application
thanks
thanks
You do not have the required permissions to view the files attached to this post.
Last edited by AleRi8 on Sat Jun 05, 2010 2:57 pm, edited 1 time in total.
You can put the images in as embedded resources for the dll project, then have some code in in your application like this:
Code: Select all
Dim dll As Assembly = Assembly.GetAssembly(GetType(ClassLibrary1.Class1))
Dim myResources As String() = dll.GetManifestResourceNames()
msgbox(myResources(0))
Dim resStream As Stream = dll.GetManifestResourceStream(myResources(0))
Dim image1 As Image = Image.FromStream(resStream)
resStream.Close()
PictureBox1.Image = image1
ok thx i'll give it ago
i tryed that but it comes up 2 errors with message box with reference.reference + object to refence to object is null
You have to have at least 1 image file as an embedded resource in your project for it to work.
lol i did add a image file i have uploaded the main app and dll source files in first post
Looks like you forgot to set the build action to embedded resource for your Image1.bmp/xddd.png files in the dll project.
lol ok thanks for your time i dont know much about dlls 

i tryed it again last night and recompiled to what you z and i had added a referance to the file but now the name classlibary1.clase highlights blue but when i recompile it as a compiler then the blue line disapears
Copyright Information
Copyright © Codenstuff.com 2020 - 2023