www.pudn.com > gprs_sms.zip > SmsDlg.cpp


/* ************************************************************************ 
	 *	 CSmsDlg.cpp :  Impliment file  of cmd Socket receive server  * 
	 *	 Version     :  0.07                                          * 
	 *	 Date        :  30th,Nov 2002                                 *  
	 *	 Author      :  Caihy                           	          * 
	 *	 Email       :  cai_hai_ying2002@163.com                      * 
 *************************************************************************/ 
 
 
#include "stdafx.h" 
#include "Sms.h" 
#include "SmsDlg.h" 
#include "AFXPRIV.H"   //USES_CONVERSION  A2W 
extern char* m_Message;           //Message 
extern char* m_Number;      //the called number  
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CSmsDlg dialog 
 
 
CSmsDlg::CSmsDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CSmsDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CSmsDlg) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
//DEL CSmsDlg::~CSmsDlg() 
//DEL { 
//DEL //	if(m_Com.GetPortOpen())  
//DEL //	{ 
//DEL //		m_Com.SetPortOpen(FALSE); 
//DEL //		AfxMessageBox("端口关闭"); 
//DEL //	} 
//DEL } 
 
 
void CSmsDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CSmsDlg) 
	DDX_Control(pDX, ID_COMMCTRL, m_Com); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CSmsDlg, CDialog) 
	//{{AFX_MSG_MAP(CSmsDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CSmsDlg message handlers 
 
BEGIN_EVENTSINK_MAP(CSmsDlg, CDialog) 
    //{{AFX_EVENTSINK_MAP(CSmsDlg) 
	ON_EVENT(CSmsDlg, ID_COMMCTRL, 1 /* OnComm */, OnOnCommCommctrl, VTS_NONE) 
	//}}AFX_EVENTSINK_MAP 
END_EVENTSINK_MAP() 
 
void CSmsDlg::OnOnCommCommctrl()  
{ 
} 
 
void CSmsDlg::SendString(CString m_strSend) 
{ 
	char TxData[400];   //only 100 characters 
	int Count = m_strSend.GetLength(); 
 
	//convert CString m_strSend to CByteArray array 
	for(int i = 0; i < Count; i++) TxData[i] = m_strSend.GetAt(i);  
 
	CByteArray array; 
	array.RemoveAll(); 
	array.SetSize(Count); 
 
	for(i=0;i' char 
} 
 
BOOL CSmsDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
 
// following code must be write if u do not use ClassWizard	 
//	DWORD style=WS_VISIBLE|WS_CHILD; 
//	if (!m_Com.Create(NULL,style,CRect(0,0,0,0),this,ID_COMMCTRL)) 
//	{ 
//		TRACE0("Failed to create OLE Communications Control\n"); 
//	    return -1; //fail to create   
//	} 
	 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
 
//DEL void CSmsDlg::OnClose()  
//DEL { 
//DEL  
//DEL //	CDialog::DestroyWindow(); 
//DEL  
//DEL 	int a = DestroyWindow(); 
//DEL 	TRACE("%d\n",a); 
//DEL 	 
//DEL 	//	CDialog::OnClose(); 
//DEL }