Click here to Skip to main content
15,894,825 members
Articles / Programming Languages / C++

3G Modem Internet Dialer

Rate me:
Please Sign up or sign in to vote.
4.90/5 (88 votes)
13 Jul 2011CPOL7 min read 776.8K   65.9K   192  
3G Modem Internet Dialer
// 3GModemConnectDlg.h : header file
//

#pragma once
#include "afxwin.h"
#include "Modem.h"
#include "TrafficDlg.h"
#include "TrayIcon.h"
#include "History.h"

// CMy3GModemConnectDlg dialog
class CMy3GModemConnectDlg : public CDialog
{
	// Construction
public:
	CMy3GModemConnectDlg(CWnd* pParent = NULL);	// standard constructor

	// Dialog Data
	enum { IDD = IDD_MY3GMODEMCONNECT_DIALOG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

	// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()

public:

	void CreateStatusBar(void);
	void SetDlgSizeToSmall(void);
	void SetDlgSizeToLarge(void);
	void FillComboWithProfiles(void);

	afx_msg LRESULT OnRasDialEvent(WPARAM wparam, LPARAM lparam);
	afx_msg LRESULT OnModemReadEvent(WPARAM wparam, LPARAM lparam);
	afx_msg LRESULT OnTrayEvent(WPARAM wparam, LPARAM lparam);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBnClickedButtonApplySignalMode();
	afx_msg void OnBnClickedButtonApnApply();
	afx_msg void OnBnClickedButtonConnect();
	afx_msg void OnBnClickedButtonExpand();
	afx_msg void OnClose();
	afx_msg void OnDestroy();
	afx_msg void OnTrayShow();
	afx_msg void OnTrayHistory();
	afx_msg void OnTrayHelp();
	afx_msg void OnTrayExit();

	CComboBox m_comboProfiles;
	CButton m_btnExpand;	


private:
	CStatusBar m_statusbar; 
	CModem* m_modem;

	void SetDuration(int iTimeInSec);
	void SetDownloadSpeed(int iSpeedInBits);
	void SetUploadSpeed(int iSpeedInBits);
	void SetUploadedData(int iSizeInBits);
	void SetDownloadedData(int iSizeInBits);
	void SetModemMode(int iMode);
	void SetBandMode(int iBand);
	void SetMode(int iMode);
	void SetRSSI(int iRSSI);
	void SetProvider(char* szProvider);
	void SetAPN(char* szAPN);
	void SetManufacturer(char* szManufacturer);
	void SetModel(char* szModel);
	void SetPort(char* szPort);
	void SetIMEI(char* szIMEI);
	void SetFirmware(char* szFirmware);
	void SetHardware(char* szHardware);
	void ShowDialError(DWORD dwError);

public:
	void HideLogin(void);
	void ShowLogin(void);

	CEdit m_edtUser;
	CEdit m_edtPassword;
	CEdit m_edtAPN;

	CStatic m_stcLogin;
	CStatic m_stcUser;
	CStatic m_stcPassword;
	CStatic m_stcAPN;
	CStatic m_stcDuration;
	CStatic m_stcDownload;
	CStatic m_stcUpload;
	CStatic m_stcDownloaded;
	CStatic m_stcUploaded;
	CStatic m_stcMode;
	CStatic m_stcSignal;
	CStatic m_stcProvider;
	CStatic m_stcManufacturer;
	CStatic m_stcModel;
	CStatic m_stcHardware;
	CStatic m_stcFirmware;
	CStatic m_stcIMEI;
	CStatic m_stcPort;

	CButton m_btnConnect;
	CButton m_btnAPNApply;

#ifdef _TRAFFIC_GRAPH
	CTrafficDlg *m_pTrafficDlg;
#endif
	CTrayIcon *m_pTrayIcon;

	CComboBox m_comboModeType;

	CComboBox m_comboBandType;

	SYSTEMTIME m_stStart; 
	SYSTEMTIME m_stEnd;

	int m_iTotalDownloaded;
	int m_iTotalUploaded;
	afx_msg void OnTrayTraffic();
};

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
Software Developer
United States United States
I love coding with C++. I always split my free time between coding and gaming Smile | :)

Comments and Discussions