Reputation: 7620
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.
Upvotes: 4
Views: 1301
Reputation: 612964
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.
Upvotes: 3