With the development of SMS platforms, alarms based on SMS platforms are increasingly used.
This article describes the implementation of a SMS control combined with the configuration part of alarm processing;
Text Due to the increasing function of SMS, SMS for alarming in the power industry is used by more and more monitoring systems. For this reason, the company leaders decided to integrate this module into our monitoring system. The previous alarms used It is voice alarm and telephone alarm. If this is added, it will be more complete. Since the power industry systems all pay attention to a configuration function, this article uses INI format files to configure and save alarm information. At the same time, the interface uses SKINMAGIC. The dialog boxes are processed using HEADCTRL. I hope that these can help VC beginners master interface programming and control usage, and file reading and writing will serve as an inspiration.
The so-called configuration is actually to use a parameter interface provided by the application to configure the application execution parameters. Users can achieve different effects through configuration without recompiling the entire project. This article uses ini files to save various information. In this article In the system configuration, the SMS alarm content is divided into two parts: fixed information alarm and metering information transmission. The fixed information will list all possible fixed alarm numbers, and the metering information transmission is to allow users to better understand each The operation of power equipment. In this system, most of the operations are on the LISTCTRL control, in which the ADO programming method is designed. The configuration information here uses a piece of information to represent an alarm point information. This point is composed of 5 points. In the middle, I used the string decomposition method to decompose and synthesize. The relevant code can be seen below:
void CMsgDemoView::DataProcessIniVal(CString strVal,int nLen)//Processing, split the content with ; sign in the middle.
{
CString szTemp;
szTemp=strVal;
CString str[10];
int nSize=1;
while(1)
{
int nCount=szTemp.Find( ; );
if(nCount==-1)
break;
str[nSize]=szTemp.Left(nCount);
szTemp=szTemp.Right(szTemp.GetLength()-nCount-1);
nSize++;
}
str[nSize]=szTemp;
//Insert ListCtrl Content
int nPos=m_List.GetItemCount();
if(!str[1].IsEmpty())
{
this->m_List.InsertItem(nPos,str[1]);
this->m_List.SetItemText(nPos,1,str[2]);
this->m_List.SetItemText(nPos,2,str[3]);
this->m_List.SetItemText(nPos,3,str[4]);
this->m_List.SetItemText(nPos,4,str[5]);
}
//Reset the temp value
m_strId[nLen]=str[1];
m_strContent[nLen]=str[2];
m_strNum[nLen]=str[3];
m_strbSend[nLen]=str[4];
m_strDes[nLen]=str[5];
}
Expand