I need the InterOp Win32 code (unmanaged Win32 DLL's and EXE) with .NET. I need to call Win32 unmanaged code (DLL exported functions) at runtime knowing the data types in Win32 signatures and to pass data according to that type at runtime.
开发者_开发问答This is possible for COM, you can convert COM unmanaged code to managed assemblies using tlbimp.exe and use a reflection API to work with those managed types (unmanaged types converted to managed using tlbimp).
How can I get the same functionality in terms of Win32 in .NET framework?
I know MS provided an Export table reading API, but I couldn't find the exact API for interop of Win32 unmanaged code.
Yes, take a look at http://www.pinvoke.net/
Using the services of System.Runtime.InteropServices you can interop with native Win32 code or any DLL that exports C type functions.
Yes.
See PInvoke on MSDN.
精彩评论