Visual c++ 在富编辑控件中查找下一个

Visual c++ 在富编辑控件中查找下一个,visual-c++,mfc,cricheditctrl,Visual C++,Mfc,Cricheditctrl,下面的代码可以找到单词的第一个匹配项: int len = m_find.LineLength(m_find.LineIndex(0)); CString path; LPTSTR p = path.GetBuffer(len); m_find.GetLine(0, p, len); path.ReleaseBuffer(); // Set the selection to be the first occurrence of the // string lpszmyString, if

下面的代码可以找到单词的第一个匹配项:

int len = m_find.LineLength(m_find.LineIndex(0));
CString path;
LPTSTR p = path.GetBuffer(len);
m_find.GetLine(0, p, len);
path.ReleaseBuffer();

// Set the selection to be the first occurrence of the  
// string lpszmyString, if it is found.   
FINDTEXTEX ft;
ft.chrg.cpMin = nEndChar;
ft.chrg.cpMax = -1;
ft.lpstrText = p;
long n = ctrl.FindText(FR_MATCHCASE|FR_WHOLEWORD|FR_DOWN, &ft);
if (n != -1)
{
    ctrl.SetSel(ft.chrgText);
}

如何查找下一个匹配项?

将chrg.cpMin成员设置为chrgText.cpMax,请参阅