简体   繁体   中英

Is .NET support for Win32 Code Interop?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM