Your statement is partially correct. In fact, common Dlls (Win32/Com) need to be registered with the tool regsvr32
while, in fact, you just need to add a C# DLL to the folder bin
so that it can be used (and it can only be used by .NET applications as you said). You can read more about it here: Difference between normal DLL and . Net DLL
It is possible to use a C++ DLL in .NET. Visual Studio creates an "Interop" file for you. Basically an INTEROP file is an interface that allows you to access the DLL resources, ie a wrapper
to the DLL where you will utilize its features without worrying about any conversion. This "Interop" file is created because of the languages. NET need type description (only to be "understood" by language). You can read more about it here: What is the Interop dll?
The opposite is also valid. You can use a DLL . NET in a C++ program. For this just follow this tutorial provided by Microsoft: How to call a Managed 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 DLL C++ and a DLL C# is the format. A DLL . NET is distributed in some sections:
- PE header
- CLR header
- CLR
- CLR IL code
- Native data
Each section is interpreted by the . NET language while the C++ DLL does not have these sections. Therefore, it needs a wrapper
as I mentioned earlier. These sections are described here: Inside . NET assemblies (part 1)