Oleksiy
Oleksiy

Reputation: 39820

First-chance exception at 0x76F8277C in SensorTest.exe: Microsoft C++ exception: Platform::COMException ^ at memory location

I've been following this tutorial, but I'm getting this exception and it's very confusing. I enabled ID_CAP_SENSORS in the manifest, so that's not the problem.

The error happens when I try to initialise accelerometer or gyroscope in my constructor:

m_accelerometer = Windows::Devices::Sensors::Accelerometer::GetDefault();
m_gyrometer = Windows::Devices::Sensors::Gyrometer::GetDefault();

enter image description here

Upvotes: 1

Views: 578

Answers (1)

Paul Annetts
Paul Annetts

Reputation: 9604

You can't test gyroscope code on the Windows Phone emulator at this time.

See http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202943(v=vs.105).aspx.

Important Note:

You cannot test this app on the emulator. The emulator doesn’t support the gyroscope. You can only test this app on a registered phone.

Also beware that not all Windows Phones have gyroscope hardware.

Upvotes: 2

Related Questions