Reputation: 7259
I'm trying to get Lat and Long data from my Windows Mobile 6.5 device using the GPS Intermediate Driver with the following code:
Gps gps = new Gps();
gps.Open();
var pos = gps.GetPosition();
while (!pos.LatitudeValid && !pos.LongitudeValid)
pos = gps.GetPosition();
gps.Close();
The problem is that I never break the loop! I tried using Bing Maps in the exact same spot and I get instant results using the GPSID.
All I need is relative (as in within 100 meters) lat and long data. I pulled the GPSID dll from the 6.5.3 DTK, so I believe that it is the most up to date. All the code that accesses the GPS is listed above, so if I'm missing something, please let me know!
Thanks
Upvotes: 3
Views: 588
Reputation: 942408
This is pretty typical for COM components, they cannot update their internal state until you pump the message loop. Which doesn't happen, you're stuck in a loop. Use a Timer instead.
Upvotes: 1