Click here to Skip to main content
12,953,743 members (43,729 online)
Click here to Skip to main content


79 bookmarked
Posted 17 Jan 2008

GPS and Web Service using C++ ATL/WTL (Windows Mobile 6, Standard)

, 18 Jan 2008 CPOL
This article explains how to use the GPS API and Web Service on a SmartPhone to show demographics information for the current location.
#pragma once
#include <GPSApi.h>
#include "IGPSSink.h"

class CGPSDevice
	//Singleton instance
	static CGPSDevice * s_pInstance;

	//Device handle
	HANDLE m_hGPS_Device;

	//Event for location data updates
	HANDLE m_hNewLocationData;

	//Event for device state changes
	HANDLE m_hDeviceStateChange;

	//Thread's handle and id
	HANDLE m_hThread;
	DWORD m_dwThreadID;

	//Exit event
	HANDLE m_hExitThread;

	//Pointer to sink interface
	IGPSSink * m_pSink;

	//Our wrapper is singleton make constructor private

	HRESULT StartThread();
	HRESULT StopThread();

	static CGPSDevice * Instance();
	static DWORD WINAPI GPSThreadProc(__opt LPVOID lpParameter);


	static HRESULT TurnOn(IGPSSink * pSink);
	static HRESULT TurnOff();

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Valentin Ivanov
Chief Technology Officer CDYNE Corporation
United States United States
Developer, Maker and Tinkerer

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 18 Jan 2008
Article Copyright 2008 by Valentin Ivanov
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid