Windows 10 for Desktop应用程序C ++上的位置API

时间:2015-08-18 08:46:29

标签: c++ windows location windows-10

似乎位置API是遗留的(?)。它不适用于GetReport(...)但是如果你设置RegisterForReport(...)就可以了。我得到的错误是关注

drivers\mobilepc\locationconvergence\api\winlegacyapi\dllapi\legacyapiimpltemplate.h(197)\LocationApi.dll!06552CA7: (caller: 06552D34) ReturnHr[PreRelease](1) tid(478) 8007139F The group or resource is not in the correct state to perform the requested operation.
    [CLocationApiImplTemplate<class CLegacyPositionRequest,&struct __s_GUID const _GUID_e4e915a9_8344_4f88_9326_2adc071d4ff6>::GetReportInterval(!m_fRegistered)]
SalesMan::AGW_CLASS::AGWLocationWin8::GetLocation> HR=8007139F
SalesMan::AGW_CLASS::AGWLocationWin8::GetLocation> reportInterval=0
drivers\mobilepc\locationconvergence\api\winlegacyapi\dllapi\legacyapiimpltemplate.h(158)\LocationApi.dll!06554401: (caller: 06554448) ReturnHr[PreRelease](2) tid(478) 800700E8 The pipe is being closed.
    [CLocationApiImplTemplate<class CLegacyPositionRequest,&struct __s_GUID const _GUID_e4e915a9_8344_4f88_9326_2adc071d4ff6>::GetReport(m_pLatLongReport == nullptr)]
drivers\mobilepc\locationconvergence\api\winlegacyapi\dllapi\legacypositionrequest.cpp(80)\LocationApi.dll!06554469: (caller: 06552BF2) ReturnHr[PreRelease](3) tid(478) 800700E8 The pipe is being closed.
    [CLegacyPositionRequest::GetReport(__super::GetReport(ReportType, ppLocationReport))]

我必须在这里说RequestPermissions(...)工作正常并返回OK。 Windows 8.1上的相同应用程序工作正常。 任何人都有任何想法?

提前谢谢你 乔治

1 个答案:

答案 0 :(得分:0)

我通过实施事件驱动的位置报告绕过了问题。 可能Windows 10初始化的位置比Windows 8慢,因为硬件是相同的。我给它一个3秒的报告间隔并报告lat / lon

乔治