DLLs
-
Hi All, I was looking through projects, especially DLL section and found out that, there are no articles describing how to create a DLL file in C#. You C# Wizards planning to write an article how to do that, or what would be an alternative in C# of the article on how to create a DLLs in C++ :) Thanks, Venet. -------- Black holes are where God divided by zero.(Steven Wright)
-
Hi All, I was looking through projects, especially DLL section and found out that, there are no articles describing how to create a DLL file in C#. You C# Wizards planning to write an article how to do that, or what would be an alternative in C# of the article on how to create a DLLs in C++ :) Thanks, Venet. -------- Black holes are where God divided by zero.(Steven Wright)
Umm.. If your looking for c# dlls its fairly easy, just choose the right project type and the assembly will be built as a DLL. If your talking about COM Dlls, its the same process I think but with a wrapper-dll.
-
Umm.. If your looking for c# dlls its fairly easy, just choose the right project type and the assembly will be built as a DLL. If your talking about COM Dlls, its the same process I think but with a wrapper-dll.
Christopher Lord wrote: If your talking about COM Dlls, its the same process I think but with a wrapper-dll. No, actually I was thinking about C# DLLs. Christopher Lord wrote: If your looking for c# dlls its fairly easy, just choose the right project type and the assembly will be built as a DLL. But do you need to have DllMain or shared section and things like that in a C# dll? Thanks, Venet. -------- Black holes are where God divided by zero.(Steven Wright)
-
Christopher Lord wrote: If your talking about COM Dlls, its the same process I think but with a wrapper-dll. No, actually I was thinking about C# DLLs. Christopher Lord wrote: If your looking for c# dlls its fairly easy, just choose the right project type and the assembly will be built as a DLL. But do you need to have DllMain or shared section and things like that in a C# dll? Thanks, Venet. -------- Black holes are where God divided by zero.(Steven Wright)
Ok, I got ya now. When you include a .NET DLL into your project, it is as if all public classes and types in it are in your project. (you may have to include the namespace with the using directive at the top) This is how you get access to System.*, they are stored in DLLs in this manner. For dynamically loading DLL's, such as in a plugin system, you only need to build an interface, and then use Assembly.Load() to get references to them. Then you can 'as' the refs to your interface and use the loaded DLL. Things like dllmain are no longer needed, since constructors of types serve that purpose now.
-
Ok, I got ya now. When you include a .NET DLL into your project, it is as if all public classes and types in it are in your project. (you may have to include the namespace with the using directive at the top) This is how you get access to System.*, they are stored in DLLs in this manner. For dynamically loading DLL's, such as in a plugin system, you only need to build an interface, and then use Assembly.Load() to get references to them. Then you can 'as' the refs to your interface and use the loaded DLL. Things like dllmain are no longer needed, since constructors of types serve that purpose now.