fix: Duplicate client in the Online list
This commit is contained in:
@@ -329,11 +329,26 @@ VOID CMy2015RemoteDlg::TestOnline()
|
||||
ShowMessage(true,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>...");
|
||||
}
|
||||
|
||||
bool IsExitItem(CListCtrl &list, DWORD_PTR data){
|
||||
for (int i=0,n=list.GetItemCount();i<n;i++)
|
||||
{
|
||||
DWORD_PTR v = list.GetItemData(i);
|
||||
if (v == data) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
VOID CMy2015RemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName, CString strOS,
|
||||
CString strCPU, CString strVideo, CString strPing, CString ver, CString st, CString tp, CONTEXT_OBJECT* ContextObject)
|
||||
{
|
||||
EnterCriticalSection(&m_cs);
|
||||
if (IsExitItem(m_CList_Online, (DWORD)ContextObject)) {
|
||||
LeaveCriticalSection(&m_cs);
|
||||
OutputDebugStringA(CString("===> '") + strIP + CString("' already exist!!\n"));
|
||||
return;
|
||||
}
|
||||
//Ĭ<><C4AC>Ϊ0<CEAA><30> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int i = m_CList_Online.InsertItem(m_CList_Online.GetItemCount(),strIP);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user