/添加树状/
HTREEITEM hItem,hChildItem; //定义树状控件的句柄
CTreeCtrl *pTree = (CTreeCtrl*)GetDlgItem(IDC_TREE);//定义一个树状控件的指针指向ID为IDC_TREE的树状控件
hItem = pTree->GetRootItem();//获取树状控件的根节点,赋给句柄hItem (这里假设“根”下面是“父节点”,“父”下面是“子节点”)
//矩阵ID
int intMatrixID = InsertMatrixDlg.m_InsertMatrixID;
char sTemid[100];
itoa(intMatrixID,sTemid,10);
sID = sTemid;
sID = "北京(ID."+sID+")";
hChildItem= pTree->InsertItem(sID.c_str(),NULL,NULL,hItem);//将hChildItem句柄指向根节点hItem的下级节点,并给这个下级节点命名字符串sID
//创建时间
sCreatTime = InsertMatrixDlg.m_InsertTime;
sCreatTime = "创建时间:" + sCreatTime;
pTree->InsertItem(sCreatTime.c_str(),NULL,NULL,hChildItem);//在父节点hChildItem(单词与假设的没有匹配)下添加子节点,并给子节点命名字符串sCreatTime
//地址
string temp;
temp = InsertMatrixDlg.m_InsertMatrixIP;
char sTemPort[100];
itoa(InsertMatrixDlg.m_InsertMatrixPort,sTemPort,10);
sMatrixAdd ="地址:" + temp + ":" + sTemPort;
pTree->InsertItem(sMatrixAdd.c_str(),NULL,NULL,hChildItem);//(添加子节点的兄弟节点)在父节点hChildItem(单词与假设的没有匹配)下添加子节点,并给子节点命名字符串sTemPort
//类型
if (InsertMatrixDlg.m_InsertType == 0 )
{
sType = "类型:XG-1200平台";
pTree->InsertItem(sType.c_str(),NULL,NULL,hChildItem);//(添加子节点的兄弟节点)
}
else if (InsertMatrixDlg.m_InsertType == 1 )
{
sType = "类型:中威平台";
pTree->InsertItem(sType.c_str(),NULL,NULL,hChildItem);//(添加子节点的兄弟节点)
}
else if (InsertMatrixDlg.m_InsertType == 2 )
{
sType = "类型:中创平台";
pTree->InsertItem(sType.c_str(),NULL,NULL,hChildItem);//(添加子节点的兄弟节点)
}
//端口
char sRet1[100],sRet2[100];
itoa(m_iniFile.m_nMatPort,sRet1,10);
itoa(InsertMatrixDlg.m_InsertMatrixPort,sRet2,10);
sPort = "端口:";
sPort = sPort + sRet2;
sPort = sPort +"-"+sRet1;
pTree->InsertItem(sPort.c_str(),NULL