something like this: bool bIdExists = false; CString strIdListTemp = ""; for(int i = 0; i< m_messageList.GetItemCount(); i++) { CString strIdList = m_messageList.GetItemText(i, 4); if( strIdList == m_yourDuplicateStr) { strIdListTemp = strIdList; bIdExists = true; } } if(bIdExists) { CString temp = ""; temp.Format("Str: %s already exists", strIdListTemp); AfxMessageBox(temp); } else { //ok, do further processing }
Alin Negru
Posts
-
Removing Duplicates from CListCtrl -
SDI and multiple viewstry on http://www.codeguru.com/doc_view/index.shtml[^]. there are a lot of examples there
-
How to maximize a child window in a MDI projectAdd a handler for WM_CREATE in CChildFrame and there ShowWindow(SW_MAXIMIZE);
-
static control colorRGB(192, 192, 192) :)
-
CListCtrl improvingJensB wrote: void CMyEdit::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) { CRect temp= GetPosition();// use CRect instead of RECT and it will work lpwndpos->x = temp.left; lpwndpos->y = temp.top; lpwndpos->cx = temp.Width(); lpwndpos->cy = temp.Right(); SetPosition(temp); }
-
static and non-static functionwow9999 wrote: Can a static function call a non-static function inside the same class? no or Can a static function call a non-static function in different class? no
-
Message Handling in Controls instead of DialogAs I understood you have your own class CComboBoxEx in which you have implemented a handler for WM_CHAR, right? And more you want to use this combo in your dialog. Then if this is correct then add a combobox to your dialog by dragging it from the resource editor and add a member variable to that combo of the type CComboBox. Then go where your variable was added and change the variable from type CComboBox to CComboBoxEx. I hope I understood corectly your question...
-
Using the perfmon tool I've seen that my application acumulates handlers, is it bad?Joan Murt wrote: I would like to know: 1. is it normal? 2. how can I know where do I occupy a handler that I don't free? 3. how do I free a handler? 1. NO, is not normal! 2. maybe it's a file HANDLE, an event HANDLE(check to see if you don't create a handle everytime you create a property sheet.(CreateEvent, CreateThread...)) 3. look at BOOL CloseHandle( HANDLE hObject // handle to object to close ); in MSDN. It's very self explanatory