开发者

Is .NET support for Win32 Code Interop?

开发者 https://www.devze.com 2022-12-31 10:26 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消