This code should give me a collection of FilterInfo objects, representing the connected devices in the chosen category, which in this case is webcams.
FilterInfoCollection collection = new FilterInfoCollection(FilterCategory.VideoInputDevice);
I tested this in a console application, and it worked great, but when i bring the code into WPF, it only returns one object.
I tried using it directly in xaml codebehind and in viewmodel bound to xaml controls, but same result.
This is so bloody frustrating
Thanks in advance =)
EDIT:
I found the cause, the WPF project “Platform Target” is set to “Any CPU”, and the console app is set to x86.
When i set the console app “Platform target” to “any cpu” it does exactly the same.
But unfortunately, the WPF project wont run when set to x86
I tried creating a new WPF project in the same solution, and now it works.
Sometimes i hate code with a passion… =P
Thanks for your help though!
I will keep my eyes open if this thing happens again.