sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.69k stars 641 forks source link

Desktop Duplication Api throws unnecessary Exception #839

Open SebastianD0tNet opened 7 years ago

SebastianD0tNet commented 7 years ago

The AquireFrame method in the desktop throws an unnessecary sharpx exception.

I like to disable the debugger option "just my code" in visual studio. i like to enable the option break on any managed exception in the debugger. now i can pin point any problem better - on source - when the debugger stop working by an exception.

We use AquireFrame in a timer and your SharpDX exception kills all debugger sessions here rapidly. Any chance to find an alternative here to create a result code?

Sebastian

xoofx commented 7 years ago

You can add a method TryAcquireNextFrame (actually rename the existing method and add in mapping.xml a check=false and add the equivalent AcquireNextFrame method using the Try method) and send a pull request (see a previous PR with similar work)

moritzuehling commented 6 years ago

@xoofx I implemented this in #977.