0

以下代码可以很好地找到单词的第一次出现:

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);
}

我如何找到下一个事件?

4

1 回答 1

-1

将 chrg.cpMin 成员设置为 chrgText.cpMax,参见http://msdn.microsoft.com/en-us/library/bb787909.aspx

于 2014-03-21T21:34:30.467 回答