Delen via


CFindReplaceDialog::GetFindString

Call this function from your callback function to retrieve the default string to find.

CString GetFindString( ) const;

Return Value

The default string to find.

Example

LRESULT CMyRichEditView::OnFindReplace(WPARAM wparam, LPARAM lparam)
{
   UNREFERENCED_PARAMETER(wparam);

   CFindReplaceDialog *pDlg = CFindReplaceDialog::GetNotifier(lparam);

   if( NULL != pDlg )
   {
      // Use pDlg as a pointer to the existing FindReplace dlg to  
      // call CFindReplaceDialog member functions 
      if(pDlg->IsTerminating())
      {
         CString   csFindString;
         CString   csReplaceString;

         csFindString = pDlg->GetFindString();
         csReplaceString = pDlg->GetReplaceString();

         VERIFY(AfxGetApp()->WriteProfileString( AfxGetApp()->m_pszAppName,
            _T("FindString"), csFindString));
         VERIFY(AfxGetApp()->WriteProfileString(AfxGetApp()->m_pszAppName,
            _T("ReplaceString"), csReplaceString));

         VERIFY(pDlg->DestroyWindow());
      }
   }

   return 0;
}

Requirements

Header: afxdlgs.h

See Also

Reference

CFindReplaceDialog Class

Hierarchy Chart

CFindReplaceDialog::FindNext

CFindReplaceDialog::GetReplaceString