GPSOpenDevice
This function creates a connection to the GPS Intermediate Driver.
Note Because this function results in turning on the GPS hardware (if it's not already turned on), this function should only be called immediately before using GPS information. For more information, see GPS Intermediate Driver Power Management.
HANDLE GPSOpenDevice(
HANDLE hNewLocationData,
HANDLE hDeviceStateChange,
const WCHAR *szDeviceName,
DWORD dwFlags
);
Parameters
- hNewLocationData
Handle to a Windows CE event created using CreateEvent, or NULL. The GPS Intermediate Driver signals the passed event whenever it has new GPS location information. - hDeviceStateChange
Handle to a Windows CE event created using CreateEvent, or NULL. The GPS Intermediate Driver signals the passed event whenever the state of the device changes. - szDeviceName
Reserved. Must be NULL. - dwFlags
Reserved. Must be 0.
Return Values
If successful, returns a handle to the GPS Intermediate Driver.
If unsuccessful, returns NULL.
Remarks
Because GPS hardware generally uses a large amount of power, the GPS Intermediate Driver keeps the GPS hardware turned off until this function is called (or a CreateFile call using the raw interface is made). Subsequent calls to this function (or to CreateFile) when the GPS hardware is already turned are reference-counted by the GPS Intermediate Driver so that the GPS Intermediate Driver can automatically turn off the GPS hardware when it is no longer in use.
Requirements
OS Versions: Windows CE 5.01 and later.
Header: Gpsapi.h.
Link Library: Gpsapi.lib.
See Also
GPS Intermediate Driver Functions | CreateEvent | CreateFile | GetLastError | Accessing Parsed GPS Data
Send Feedback on this topic to the authors