简体   繁体   中英

Location API on Windows 10 for Desktop applications C++

it seems that location API is legacy(?). It does not work the GetReport(...) but works ok if you set RegisterForReport(...) The error I get is the follow

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))]

I must say here that RequestPermissions(...) works fine and returns OK. The same application on windows 8.1 works fine. Anyone any idea?

Thank you in advance George

I bypassed the problem by implementing the event driven location report. Probably Windows 10 initialize slower the location than windows 8 , since the hardware is the same. I give it a 3 seconds report interval and reports back the lat/lon

George

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM