I'm writing a C# application that must read the video properties of video files. The only way I've found to do this is with the Microsoft Media Foundation which requires C++.
So far, I've made some progress:
What I would like to do next is have the DLL return an object of video properties (width, height, duration, etc.). Given I'm using C++ managed code, is there a simple way to define an object type and use it to pass data between C# and C++ or do I have to use the Marshal class?
Certainly! If you define a public object in your managed C++ (Also called C++/CLI):
public ref class MyManagedClass{
. . .
}
and then reference the dll from your c# project, you'll be able to use the object just like you had defined it in c#.