Your statement is partially correct. In fact, common DLLs (win32 / Com) need to be registered with the regsvr32
tool while in fact, you only need to add a C # DLL in the bin
folder so that it can be used (and it can only be used used by .NET applications as you said). You can read more about this here: Difference between normal DLL and .Net DLL
You can use a C ++ DLL in .NET languages. For this Visual Studio creates an "interop" file for you. Basically a INTEROP file is an interface that allows you to access the resources of the DLL, that is, a wrapper
to the DLL in which you will use the resources of the DLL without worrying about any conversion. This "interop" file is created because .NET languages need type description (only to be "understood" by the language). You can read more about it here: What is the interop dll?
The opposite is also valid. You can use a .NET DLL in a C ++ program. To do so, simply follow the tutorial provided by Microsoft : How to call a DLL from native Visual C ++ code in Visual Studio .NET or in Visual Studio 2005
Now answering the fundamental question. The difference, after compiled, between a C ++ DLL and a C # DLL is the format. The .NET DLL is partitioned into some sections:
- PE header
- CLR header
- CLR metadata
- CLR IL code
- Native data
Each section is interpreted by the .NET language while the C ++ DLL does not have these sections. For this reason, it needs a wrapper
as I mentioned earlier. These sections are described here: Inside .NET assemblies (part 1)