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

📄 shortmessage.h

📁 收发短信ocx控件
💻 H
字号:
// ShortMessage.h: interface for the CShortMessage class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SHORTMESSAGE_H__C08453D4_9BC3_41C4_8385_507C64793B9D__INCLUDED_)
#define AFX_SHORTMESSAGE_H__C08453D4_9BC3_41C4_8385_507C64793B9D__INCLUDED_

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

#include "stdafx.h"
#include "afxtempl.h"
#include "SMSPDU.h"

struct CSMSItem
{
	CSMSItem()
	{
		memset(szCallCenter, 0, 20);
		memset(szSMSContent, 0, 200);
		memset(szDateTime, 0, 20);
		memset(szCallNumber, 0, 20);
		bstrSMSInfomation=_T("");
	}
	char szCallCenter[20];			//短信中心
	char szSMSContent[200];			//短信内容
	char szDateTime[20];			//日期时间
	char szCallNumber[20];			//短信发送号码
	COleDateTime	dtSMSDateTime;		//日期时间,对象形式
	/*
	CString			bstrCallcenter;		//短信中心
	CString			bstrSMSContent;		//短信内容
	CString			bstrDateTime;		//日期时间
	CString			bstrCallNumber;		//短信发送号码
	*/
	CString			bstrSMSInfomation;	//短信原始信息
};
//typedef CArray<CSMSItem*, CSMSItem*>	CSMSItemArray;

class CShortMessage : public CSMSPDU, CArray<CSMSItem*, CSMSItem*>
{
public:
	CShortMessage();
	virtual ~CShortMessage();

public:
	BOOL GetBOF()			{ return m_bBOF; }						//是否处于第一条
	BOOL GetEOF()			{ return m_bEOF; }						//是否处于最后一条
	int GetCount()			{ return GetSize();}					//短信的数量

	DATE GetDateTime();												//当前短信的日期时间
	LPCTSTR GetDateString();										//当前短信的日期时间
	LPCTSTR GetCallCenter();										//当前短信的短信中心
	LPCTSTR GetCallNumber();										//当前短信的发送号码
	LPCTSTR GetSMSContent();										//当前短信的短信内容

	void MoveFirst();												//移到最前
	void MovePrev();												//前移
	void MoveNext();												//后移
	void MoveLast();												//移到最后

	void Open(LPCTSTR szSmsInfo);									//初始化函数

protected:
	char * HexStringToBinString(LPCTSTR szbuff);
	char BinStringToChar(LPCTSTR szbuff);

	CString Convert7BitString(LPCTSTR szBuf);

	void ResolveSMSInfoList(CString bstrInfo);
	BOOL ResolveSMSInfo(CSMSItem & pItem, CString bstrInfo);

private:
	CString			m_szContent;		//传递进来的原始信息
	//CSMSItemArray	m_smsItemArray;		//保存短信的信息列表
	int				m_nPos;				//当前的游标
	BOOL			m_bBOF;				//游标处于最开始位置
	BOOL			m_bEOF;				//游标处于最末尾位置
};

#endif // !defined(AFX_SHORTMESSAGE_H__C08453D4_9BC3_41C4_8385_507C64793B9D__INCLUDED_)

⌨️ 快捷键说明

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