Groups | Blog | Home
all groups > c# > june 2004 >

c# : Dynamically linking a dll...


Robert Vasquez
6/25/2004 11:25:01 PM
How can I dynamically link a dll to my C# project. I specifically would like to create a resource dll that I can later load as required by my application. Any help is appreciated.


Shakir Hussain
6/26/2004 12:37:31 PM
Robert,

If you have a .NET dll, you can simply add it as reference and include its
namespace.

If you want to use your C++ dll (no resources), you can use DllImport to
get access to the functions. Refer MSDN about DllImport.

If you want to use a MFC dll with dialogs, It would be very convinent to use
VC.NET. You can directly include the class headers and still take advantage
..NET framework.

If you just need to call a function which will launch a dialog, use
DllImport. If you want a modal dialog, you have to pass the application
handle to dll, and dialog has to use that handle as parent.

COM dll would be better solution in c#

--
Shak
(Houston)


[quoted text, click to view]
like to create a resource dll that I can later load as required by my
application. Any help is appreciated.
[quoted text, click to view]

mohamed.mossad NO[at]SPAM egdsc.microsoft.com
6/26/2004 1:30:35 PM

Hi Robert
I guess you need to build a satellite assembly and load it if needed at run
time
Check this link

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

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
AddThis Social Bookmark Button