I am using a lib to preview and capture snapshots from capture cards.
The lib: http://www.codeproject.com/Articles/34663/DirectShow-Examples-for-Using-SampleGrabber-for-Gr
It was built for .net 2.0 and everything works perfectly when those classes and controls are called from .net 2.0 or 3.5 projects.
When I add the reference to it from a .net 4.0 project, I am getting a fantastic exception.
Arithmetic operation resulted in an overflow.
when trying to:
GCHandle handle = GCHandle.Alloc(this.savedArray, GCHandleType.Pinned);
int scan0 = (int)handle.AddrOfPinnedObject();
I would happily change my app to .net 2.0 but I need it to be in .net 4.0 to reference some other libs.
I have no idea how to solve this. I have tried to compile those libs in .net 4.0 and succeeded, but when executing that piece of code, same problem. Could it be a problem in .net 4.0?
I am lost. It would be perfect if you could provide some guidance in this matter.