10

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.

4

2 回答 2

16

“如何破译这样的错误”...

对于任何 WinRT 源错误,您可以获取参数列表中的第三个地址(在您的示例中为 0x03CEE72C),并在内存窗口中找到错误描述。

在调试时,在抛出错误时中断并通过 Debug -> Windows -> Memory -> Memory 1 打开内存窗口

复制并粘贴地址以获取“易于查找”的错误消息。

于 2014-04-01T21:41:32.970 回答
2

正如拉曼所说 - 最好查看显示的十六进制值。第一个是内存位置,如果没有符号/源,它不会告诉你太多,在这种情况下,它是由 Windows 直接报告的。也许公共符号可以更清楚地说明错误的来源,但错误代码查找更有帮助。

如果您对 0x80070057 进行 Bing,您将找到一篇关于Common HRESULT Values的 MSDN 文章,其中列出了

E_INVALIDARG:一个或多个参数无效:0x80070057

当然,它并没有给你所有的细节,所以你要去理论化。也许您只能调用args->GetCurrentPoint(nullptr)一次并且应该存储/重用该值?也许手势识别器配置不正确?可能在抛出异常或线程错误时应用程序窗口不可见。"if"可能由于使用这些语句过滤掉了一些预期的对手势识别器的调用。

于 2014-01-18T05:30:37.553 回答