Click here to Skip to main content
15,896,912 members
Articles / Mobile Apps / Windows Mobile

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

Rate me:
Please Sign up or sign in to vote.
4.93/5 (27 votes)
18 Jan 2008CPOL7 min read 106.9K   1.4K   81  
This article explains how to use the GPS API and Web Service on a SmartPhone to show demographics information for the current location.
// DemographicsFrame.h : interface of the CDemographicsFrame class
//
/////////////////////////////////////////////////////////////////////////////

#pragma once

class CDemographicsFrame : 
	public CFrameWindowImpl<CDemographicsFrame>, 
	public CUpdateUI<CDemographicsFrame>,
	public CAppWindow<CDemographicsFrame>,
	public CFullScreenFrame<CDemographicsFrame>,
	public CMessageFilter, public CIdleHandler
{
	BOOL m_bUseGPS;
public:
	DECLARE_APP_FRAME_CLASS(NULL, IDR_MAINFRAME, L"Software\\WTL\\Demographics")

	CDemographicsView m_view;

	virtual BOOL PreTranslateMessage(MSG* pMsg);

// CAppWindow operations
	bool AppHibernate( bool bHibernate);

	bool AppNewInstance( LPCTSTR lpstrCmdLine);

	void AppSave();

	void AppBackKey();

	virtual BOOL OnIdle();


	BEGIN_UPDATE_UI_MAP(CDemographicsFrame)
		UPDATE_ELEMENT(ID_MENU_USEGPS, UPDUI_MENUPOPUP)
	END_UPDATE_UI_MAP()

	BEGIN_MSG_MAP(CDemographicsFrame)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
		COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
		COMMAND_ID_HANDLER(ID_ACTION, OnAction)
		COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
		COMMAND_ID_HANDLER(ID_MENU_USEGPS, OnUseGPS)
		CHAIN_MSG_MAP(CAppWindow<CDemographicsFrame>)
		CHAIN_MSG_MAP(CFullScreenFrame<CDemographicsFrame>)
		CHAIN_MSG_MAP(CUpdateUI<CDemographicsFrame>)
		CHAIN_MSG_MAP(CFrameWindowImpl<CDemographicsFrame>)
	END_MSG_MAP()


	VOID UseGPS( BOOL bUse = TRUE );

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

	LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	LRESULT OnAction(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	LRESULT OnUseGPS(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);



};

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)


Written By
Chief Technology Officer CDYNE Corporation
United States United States
Developer, Maker and Tinkerer

Comments and Discussions