开发者

How to use *.lib file in C# application?

开发者 https://www.devze.com 2022-12-31 13:16 出处:网络
So I have some .lib file (generated like this one) How to use it f开发者_如何学编程rom my C# WPF application?When you want to use native libraries from C# you won\'t need a .lib file. The way this is

So I have some .lib file (generated like this one) How to use it f开发者_如何学编程rom my C# WPF application?


When you want to use native libraries from C# you won't need a .lib file. The way this is handled in .NET is by using Platform Invoke (P/Invoke). I suggest you follow the tutorial on MSDN, it will get you started:

Platform Invoke Tutorial

If you want to generate a wrapper you might want to have a look at the P/Invoke Interop Assistant on CodePlex. Please note that this tool works on the original C/C++ code. Using a .dll file to create a wrapper is not feasible because native DLLs don't store the signature of the exported functions (as described in this thread) and a lib file will store the signature in a compiler specific way.

0

精彩评论

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

关注公众号