Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinRT - Windows Store - WinRT Originate Error - How do decipher such an error?

I'm working on a Windows Store app and I'm getting a WinRT error that doesn't really give me any information so I would like to know how to understand these sorts of errors.

Basically I get the error on the following line which is called inside OnPointerPressed:

m_gestureRecognizer->ProcessDownEvent(args->GetCurrentPoint(nullptr));

The error is:

First-chance exception at 0x76F54B32 (KernelBase.dll) in DXAML2.exe: 0x40080201: WinRT originate error (parameters: 0x80070057, 0x00000044, 0x03CEE72C).

This error didn't used to appear, the only thing I've changed is that this line is now wrapped in an if clause which tests if the current pointer's PointerId is the same as one I've stored just using == such as:

if(args->GetCurrentPoint(nullptr)->PointerId == m_UIPointerID)

I have no idea why this has started happening.

So my question is in two parts:

  1. More generally, how do I understand what an error such as the above means?
  2. And does anyone know this error has suddenly started happening now that I check the pointerId?

Thanks for your time.

P.S. I guess another thing that has changed is that there will already be 2 pointers on the screen (the one that gets pushed into this GestureRecognizer) as well as another one, hence the PointerId check.

like image 674
poncho Avatar asked Aug 21 '13 17:08

poncho


2 Answers

"How to Decipher such an error"...

For any WinRT originate error, you can take the third address in the parameters list (in your example, 0x03CEE72C), and find a description of your error in the memory window.

While debugging, break when your error is thrown and open the memory window via Debug -> Windows -> Memory -> Memory 1

Copy and paste the address to get your "easy-to-find" error message.

like image 91
steveb Avatar answered Sep 26 '22 19:09

steveb


As Raman said - it's good to look up the hex values shown. The first one is the memory location which won't tell you much without the symbols/source, which in this case is reported directly by Windows. Perhaps the public symbols can shed some more light on where the error came from, but the error code lookups are more helpful.

If you Bing for 0x80070057 you will find an MSDN article on Common HRESULT Values which lists

E_INVALIDARG : One or more arguments are not valid : 0x80070057

It doesn't give you all the details of course, so you're off to theorize. Perhaps you can only call args->GetCurrentPoint(nullptr) once and you should store/reuse the value? Maybe gesture recognizer is not configured correctly? Maybe the app window is not visible at the time the exception is thrown or the thread is wrong. Maybe some expected calls to gesture recognizer were missed due to filtering those out with these "if" statements.

like image 45
Filip Skakun Avatar answered Sep 22 '22 19:09

Filip Skakun