Retrieving a Location Object
To retrieve a location object, you use the ILocation interface. You can think of this interface as the root interface for the Location API. To use ILocation, you must first call the COM CoCreateInstance method.
The following example code creates an instance of the location object.
// Declare a smart pointer to receive the // location interface pointer. CComPtr<ILocation> spLocation; // Create the location object. hr = spLocation.CoCreateInstance(CLSID_Location);
After successfully retrieving the location object, you can retrieve location reports, or register to handle report events.
- The Location Object in C++
- Location Reports in C++
- Polling for Location Reports
- Location Events in C++
- Responding to Location Report Events