Link to home
Start Free TrialLog in
Avatar of knobloch
knobloch

asked on

How to load over 40 dll files into C# application.

Hi
I have a little problem with dll files.
My application requires over 40 dll, which contain images for Windows Forms, and I just wonder what is the best way to load these dll into application. Problem is that dll files are stored in different subfolders of main application; I want to call it dynamically when I need it.

Could anyone tell me how to do it and how to access images from dll files?
I will appreciate sample code!!
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

you would use the Assembly object to open the .dll the use  Assembly.GetManifestResourceStream("namespace." + strIdentifier)); to get the embedded resource

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemReflectionAssemblyClassGetManifestResourceStreamTopic2.asp

you would then use Image.FromStream() to load an image from the resource strem.
Avatar of knobloch
knobloch

ASKER

Could you write a sample code for me?
How can I access for example "image1.gif" from ../mySubfolder/myFile.dll ?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
That’s good enough for me.