⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sgipservicedemodlg.h

📁 1、自己编写的遵循SGIP1.1协议的短信客户端程序。仅供测试、学习。 2、该程序只实现了SGIP1.1协议的一部分。
💻 H
字号:
// SgipServiceDemoDlg.h : header file
//

#if !defined(AFX_SGIPSERVICEDEMODLG_H__BC75397B_BBF6_4D71_BC2E_674A9938629C__INCLUDED_)
#define AFX_SGIPSERVICEDEMODLG_H__BC75397B_BBF6_4D71_BC2E_674A9938629C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CSgipServiceDemoDlg dialog
#include "SocketResource.h"
#include "SgipListenSocket.h"
#include "IniFile.h"
#include "LogFile.h"
#include "afxmt.h"

class CSgipServiceDemoDlg : public CDialog
{
//Attributes
public:
	static int m_iTestPhase;//-1:not init plat
	                 //0:init plat,but no test run
					 //1:start mtct
					 //2:start moct
					 //3:start momtct
	long	m_iCorpID;
	CString	m_strDestPnoneNo;
	CString	m_strFeePhoneNo;
	int		m_iFeeType;
	int		m_iFeeValue;
	int		m_iLocalLisPort;
	CString	m_strLocalPwd;
	CString	m_strLocalUserName;
	CString	m_strMsgContent;
	int		m_iMsgFmt;
	int		m_iMsgLevel;
	int		m_iRepFlag;
	CString	m_strServerIP;
	CString	m_strServerPwd;
	int		m_iServerLisPort;
	CString	m_strServerUserName;
	long	m_lSourceID;
	int	m_iSPNumber;


	BOOL m_bStartTest;
	BOOL m_bStartMtctTest;

	CSocketResource m_SocketRes;//the sockets(client&server) manager

	HANDLE m_hTMTAppExit;//系统退出信号量 for MT capacity test thread
	HANDLE m_hTMTExit;//
	HANDLE m_hTMOAppExit;//系统退出信号量 for MO capacity test thread
	HANDLE m_hTMOExit;//
	HANDLE m_hTMOMTAppExit;//系统退出信号量 for MOMT capacity test thread
	HANDLE m_hTMOMTExit;//

protected:
	CIniFile m_iniFile;
	CLogFile m_logFile;
	int ReadConfigInfo();
	int WriteConfigInfo();

//	static CSMSSubmitRespList m_SMSSubmitRespList;
	static CSMSDeliverList m_SMSDeliverList;
	static CSMSReportList m_SMSReportList;

//	static CCriticalSection m_csSMSSubmitResp;
	static CCriticalSection m_csSMSDeliver;
	static CCriticalSection m_csSMSReport;

	CCriticalSection m_csShowRunstate;
//Operations
public:
//	int GetSMSSubmitResp(SMSSubmitResp &smssubmitresp);
	int GetSMSDeliver(SMSDeliver &smsdeliver);
	int GetSMSReport(SMSReport &smsreport);
	////////////////////////////////////////////////////////////////
	//sms callback functions
//	static int Callback_OnSMSSubmitResp(unsigned long ulTimeID, 
//							unsigned long ulSgipSerial,
//							int iSubmitResult);
	static int Callback_OnSMSDeliver(unsigned long ulSgipSerial,
						 unsigned long ulTimeID,
						 CString strGSMNo,
						 CString strDeliverMsg);
	static int Callback_OnSMSReport(unsigned long ulSgipSerial,
						unsigned long ulTimeID,
						CString strGSMNo,
						int iState,
						int iErrorCode);

	void ShowRunState(CString strContent,int iWhoCall = 1);
	
	int SubmitOneMsg(CString strContent,CString strDestPhoneNum, CString strFeePhoneNo, unsigned long ulSgipSerialNo,int iReportFlag, int iMsgCoding, BOOL bWaitResp);

	CSgipServiceDemoDlg(CWnd* pParent = NULL);	// standard constructor
// Dialog Data
	//{{AFX_DATA(CSgipServiceDemoDlg)
	enum { IDD = IDD_SGIPSERVICEDEMO_DIALOG };
	CButton	m_BtnMTCTStop;
	CButton	m_BtnConfig;
	CButton	m_BtnStopTest;
	CListCtrl	m_lstrunstate;
	CButton	m_BtnStartTest;
	CButton	m_BtnMTMOStop;
	CButton	m_BtnMTMOStart;
	CButton	m_BtnMOCTStop;
	CButton	m_BtnMOCTStart;
	CButton	m_BtnMTCTStart;
	CString	m_strEditMOCTBeginTime;
	CString	m_strEditMOCTEndTime;
	CString	m_strEditMTCTBeginTime;
	CString	m_strEditMTCTEndTime;
	CString	m_strEditMTMOBeginTime;
	CString	m_strEditMTMOEndTime;
	BOOL	m_bViewState;
	BOOL	m_bLogState;
	UINT	m_iEditMTCTSPNMax;
	UINT	m_iEditMTCTSPNPerSecond;
	UINT	m_iEditMOCTRPN;
	UINT	m_iEditMTMORPN;
	UINT	m_iEditMTMOSPN;
	BOOL	m_bWaitResp;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSgipServiceDemoDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CSgipServiceDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBtnMtctstart();
	afx_msg void OnBtnMoctstart();
	afx_msg void OnBtnMoctstop();
	afx_msg void OnBtnMtmostart();
	afx_msg void OnBtnMtmostop();
	afx_msg void OnBtnStarttest();
	afx_msg void OnBtnConfig();
	afx_msg void OnBtnStoptest();
	virtual void OnCancel();
	afx_msg void OnCheckViewstate();
	afx_msg void OnCheckLogstate();
	afx_msg void OnBtnMtctstop();
	afx_msg void OnCheckWaitresp();
	//}}AFX_MSG
	afx_msg LRESULT Dlg_OnUpdateData(WPARAM TrueOrFalse, LPARAM Len);
	//由于调用异步socket的create()需由主线程来完成(不然会使其onconnect等无法正常工作),
	//所以当某个socket因各种各样的原因关闭之后,主窗口需响应WM_USER_REINITSOCKET消息,然后
	//create被关闭的socket。
	afx_msg LRESULT OnReInitSocket(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.


#endif // !defined(AFX_SGIPSERVICEDEMODLG_H__BC75397B_BBF6_4D71_BC2E_674A9938629C__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -