CFindReplaceDialog::CFindReplaceDialog

构造 CFindReplaceDialog 对象。

CFindReplaceDialog();

备注

由于 CFindReplaceDialog 对象是无模式对话框中,使用 new 运算符,则必须生成它在堆。

在销毁时,框架尝试执行指针上的 delete this 到对话框。如果创建了堆栈的对话框,this指针不存在,并且未定义的行为可能发生。

有关 CFindReplaceDialog 对象构造的更多信息,请参见 CFindReplaceDialog 概述。使用 CFindReplaceDialog::Create 成员函数显示对话框。

示例

// m_pFRDlg is a pointer to a class derived from CFindReplaceDialog 
// which defines variables used by the FINDREPLACE structure. 
// InitFindReplaceDlg creates a CFindReplaceDialog and initializes
// the m_fr with the data members from the derived class
void CMyRichEditView::InitFindReplaceDlg() 
{
   if(NULL == m_pFRDlg)
   {
      m_pFRDlg = new CMyFindReplaceDialog();  // Must be created on the heap

      m_pFRDlg->Create(TRUE, _T(""), _T(""), FR_DOWN, this); 

      m_pFRDlg->m_fr.lStructSize = sizeof(FINDREPLACE);
      m_pFRDlg->m_fr.hwndOwner = this->m_hWnd;
      m_pFRDlg->m_fr.lpstrFindWhat = m_pFRDlg->GetFindWhatStr();
      m_pFRDlg->m_fr.lpstrReplaceWith = m_pFRDlg->GetReplaceWithStr();
      m_pFRDlg->m_fr.wFindWhatLen =  m_pFRDlg->GetFindWhatStrLen();
      m_pFRDlg->m_fr.wReplaceWithLen =  m_pFRDlg->GetReplaceWithStrLen();
   }
}

要求

标头: afxdlgs.h

请参见

参考

CFindReplaceDialog选件类

层次结构图

CFindReplaceDialog::Create