Wrapper For C Static Library

2019-05-06 14:40发布

问题:

I Have is C Static Library for Camera. Now Plan is to develop C#/WPF UI for Windows 8 which will use the C static library to capture video/Audio.

I came with the idea that there will C++/CLI wrapper for the C Static.The Wrapper will be Managed Dll.

C#/WPF UI will use this Dll to Capture the Video/Audio.

I wanted to Know whether this approach will be good.

Alternate Suggestion is welcome.Please Guys Suggest on this.

回答1:

This is indeed a very common solution to the problem. It is generally much easier to do it this way than using P/invoke.

Both approaches require you to wrap the static library. So you are almost certainly better off using C++/CLI for that wrapper since that is much easier to connect to your C# code than P/invoke.



标签: c# c++-cli