문제

So I have some .lib file (generated like this one) How to use it from 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top