How does .NET allow API build of compiled DLLs?

How does .NET allow compiled DLL lookup APIs?

+2


source to share


4 answers


Since DLL contains metadata about all types, methods, etc. Even the actual code is in IL, not native code.



Basically the .NET binary is still at a higher level than the native binary, and contains a lot more information about what's in there. This allows Reflection to work.

+7


source


I'm not sure what you are asking about this, but I can only recommend the free .NET Reflector tool that allows you to explore a compiled .NET assembly.



I use it a lot more these days than I even use the published MSDN documentation because it is much faster to navigate and more informative to download.

+1


source


It depends.

The DLL contains a list of exported functions, but they can be simply assigned a number, a name, or they can be mangled C ++ name. The latter may give some insight into the parameters of a function, but data structures that call conventions and other required attributes are usually not documented.

If it is a COM DLL, there is a possibility that it contains the type library as a resource, but this is not guaranteed. In this case .NET can automatically import the library.

A type library can also be included in a non-COM library, but this is not a widespread practice.

If you have a compiled DLL that is meant to be called from a non-COM environment without control, you will need to translate the header files that the DLL must include.

0


source


One word: reflector

-1


source







All Articles