抓包代码错误求助
LRESULT CIPMDlg::OnRecv(WPARAM wParam, LPARAM lParam){
CIPMDlg *p = (CIPMDlg *)wParam;
CString ipsrc(Common::dword2char(p->srcip));
CString ipdes(Common::dword2char(p->dstip));
CString proto(Common::GetProtocol(p->proto));
int count = m_CListCtrl.GetItemCount();
for (int i = 0; i < count; i++)
{
if (ipsrc == m_CListCtrl.GetItemText(i, 0) &&
ipdes == m_CListCtrl.GetItemText(i, 1) &&
proto == m_CListCtrl.GetItemText(i, 2))
{
int pcount = atoi((LPCTSTR)m_CListCtrl.GetItemText(i, 3));
CString pcountstr;
pcountstr.Format("%d", pcount + 1);
m_CListCtrl.SetItemText(i, 3, pcountstr);
UpdateData(FALSE);
return 0;
}
}
m_CListCtrl.InsertItem(count, ipsrc);
m_CListCtrl.SetItemText(count, 1, ipdes);
m_CListCtrl.SetItemText(count, 2, proto);
m_CListCtrl.SetItemText(count, 3, CString("1"));
UpdateData(FALSE);
GlobalUnlock((HGLOBAL)p);
return 0;
}
这个问题怎么解决啊,感觉没啥问题啊。。。。顺便问一下,怎么在帖子里面插入代码 编码的问题,修改下就好了,
页:
[1]