Click here to Skip to main content
11,496,146 members (607 online)
Click here to Skip to main content
Add your own
alternative version

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

, 18 Jan 2008 CPOL 65.9K 1.1K 79
This article explains how to use the GPS API and Web Service on a SmartPhone to show demographics information for the current location.
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
gpsdemographics.zip
GPSDemographicsSetup
GPSDemographicsSetup.vddproj
GPSDemographics
com_cdynews
DemographixQuery.disco
DemographixQuery.wsdl
results.discomap
res
background.bmp
Demographics.ico
gpsdemographicssetupcab.zip
GPSDemographicsSetup.CAB
// DemographicsView.h : interface of the CDemographicsView class
//
/////////////////////////////////////////////////////////////////////////////

#pragma once
#include "IGPSSink.h"

class CDemographicsView : 
	public CWindowImpl<CDemographicsView>,
	public IGPSSink
{
	GPS_DEVICE m_gpsDevice;
	GPS_POSITION m_gpsPosition;
	DemographixQuery::SummaryInformation m_info;
	CRITICAL_SECTION m_cs;
	CBitmap m_hBackground;
	
	CFontHandle m_DefaultFont;
	CFont m_DefaultFontBold;
	CFont m_SmallFont;
	CFont m_SmallFontBold;

	double m_oldLat;
	double m_oldLong;
public:
	DECLARE_WND_CLASS(NULL)

	CDemographicsView();
	virtual ~CDemographicsView();

	BOOL PreTranslateMessage(MSG* pMsg);

	BEGIN_MSG_MAP(CDemographicsView)
		MESSAGE_HANDLER(WM_PAINT, OnPaint)
		MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
	END_MSG_MAP()

	// Handler prototypes (uncomment arguments if needed):
	//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
	//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

	LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);

	HRESULT SetGPSPosition(GPS_POSITION gps_Position);
	HRESULT SetGPSDeviceInfo(GPS_DEVICE gps_Device);
	INT TextOut(INT x, INT y, LPCTSTR szText, CDC & dc, HFONT hfont);
};

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.

License

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

Share

About the Author

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

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