Click here to Skip to main content
15,903,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDialolgProc doesnt work Pin
Tili2-Dec-02 21:36
Tili2-Dec-02 21:36 
GeneralRe: DialolgProc doesnt work Pin
Rickard Andersson202-Dec-02 23:14
Rickard Andersson202-Dec-02 23:14 
GeneralRe: DialolgProc doesnt work Pin
Paul M Watt3-Dec-02 5:55
mentorPaul M Watt3-Dec-02 5:55 
GeneralRe: DialolgProc doesnt work Pin
Tili3-Dec-02 21:54
Tili3-Dec-02 21:54 
QuestionWhy can't use CFindReplaceDialog as A Base Class? Pin
zhdleonid2-Dec-02 21:17
zhdleonid2-Dec-02 21:17 
AnswerRe: Why can't use CFindReplaceDialog as A Base Class? Pin
jhwurmbach2-Dec-02 21:35
jhwurmbach2-Dec-02 21:35 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
zhdleonid2-Dec-02 22:02
zhdleonid2-Dec-02 22:02 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
zhdleonid2-Dec-02 23:17
zhdleonid2-Dec-02 23:17 
i have tried it .

but it is failed.

i find that if only replace the CDialog to CFindReplaceDialog is not the all
.
must be change more:
------------------------
<br />
// MyFindDlg.cpp : implementation file<br />
//<br />
#include "stdafx.h"<br />
#include "CFindTest.h"<br />
#include "MyFindDlg.h"<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CMyFindDlg dialog<br />
<br />
IMPLEMENT_DYNAMIC(CMyFindDlg, CFindReplaceDialog) //NEW ADD:-O<br />
 <br />
CMyFindDlg::CMyFindDlg(BOOL bFindDialogOnly, LPCTSTR lpszFindWhat,<br />
             LPCTSTR lpszReplaceWith, DWORD dwFlags, CWnd* pParentWnd )<br />
	: CFindReplaceDialog() //NEW Add:-O<br />
  //you see CFindReplaceDialog() must be none parameter<br />
{<br />
}<br />
<br />
/*<br />
void CMyFindDlg::DoDataExchange(CDataExchange* pDX)<br />
{<br />
	CFindReplaceDialog::DoDataExchange(pDX);<br />
	//{{AFX_DATA_MAP(CMyFindDlg)<br />
		// NOTE: the ClassWizard will add DDX and DDV calls here<br />
	//}}AFX_DATA_MAP<br />
}<br />
*/ // it MUST BE DEL:-O<br />
<br />
BEGIN_MESSAGE_MAP(CMyFindDlg, CFindReplaceDialog)<br />
	//{{AFX_MSG_MAP(CMyFindDlg)<br />
	//}}AFX_MSG_MAP<br />
END_MESSAGE_MAP()<br />
<br />


-------------------------------------
<br />
#if !defined(AFX_MYFINDDLG_H__0F4D5405_8798_432C_91D0_46FB54833CE7__INCLUDED_)<br />
#define AFX_MYFINDDLG_H__0F4D5405_8798_432C_91D0_46FB54833CE7__INCLUDED_<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
// MyFindDlg.h : header file<br />
//<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CMyFindDlg dialog<br />
class CMyFindDlg : public CFindReplaceDialog<br />
{<br />
	DECLARE_DYNAMIC(CMyFindDlg)  //NEW ADD:-O<br />
// Construction<br />
public:<br />
    CMyFindDlg( BOOL bFindDialogOnly,     //NEW ADD:-O<br />
             LPCTSTR lpszFindWhat,<br />
             LPCTSTR lpszReplaceWith = NULL,<br />
             DWORD dwFlags = FR_DOWN, <br />
             CWnd* pParentWnd = NULL );<br />
protected:<br />
	// Generated message map functions<br />
	//{{AFX_MSG(CMyFindDlg)<br />
	//}}AFX_MSG<br />
	DECLARE_MESSAGE_MAP()<br />
};<br />
//{{AFX_INSERT_LOCATION}}<br />
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.<br />
#endif // !defined(AFX_MYFINDDLG_H__0F4D5405_8798_432C_91D0_46FB54833CE7__INCLUDED_)<br />

---------------------

that is my NEW Class CMyFindDLg.

i use it in the CMainFrame ,but it has Failed.
void CMainFrame::OnFind() //a new
{
// TODO: Add your command handler code here
CMyFindDlg dlg; // i want to declare the Class CMyFindDlg object .Cry | :((
}

but have a error:
: error C2512: 'CMyFindDlg' : no appropriate default constructor available

how i will do ?????

thanks.

i feel good.
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
jhwurmbach2-Dec-02 23:43
jhwurmbach2-Dec-02 23:43 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
zhdleonid3-Dec-02 0:49
zhdleonid3-Dec-02 0:49 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
jhwurmbach3-Dec-02 1:24
jhwurmbach3-Dec-02 1:24 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
zhdleonid3-Dec-02 2:40
zhdleonid3-Dec-02 2:40 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
Christian Graus2-Dec-02 23:43
protectorChristian Graus2-Dec-02 23:43 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
zhdleonid3-Dec-02 0:52
zhdleonid3-Dec-02 0:52 
GeneralRe: Why can't use CFindReplaceDialog as A Base Class? Pin
Christian Graus3-Dec-02 10:29
protectorChristian Graus3-Dec-02 10:29 
GeneralCopyright sign © in about box Pin
Geert Delmeiren2-Dec-02 20:28
Geert Delmeiren2-Dec-02 20:28 
GeneralRe: Copyright sign © in about box Pin
Rickard Andersson202-Dec-02 21:35
Rickard Andersson202-Dec-02 21:35 
GeneralRe: Copyright sign © in about box Pin
Geert Delmeiren2-Dec-02 23:09
Geert Delmeiren2-Dec-02 23:09 
GeneralRe: Copyright sign © in about box Pin
Anonymous3-Dec-02 2:49
Anonymous3-Dec-02 2:49 
GeneralRe: Copyright sign © in about box Pin
Geert Delmeiren3-Dec-02 20:24
Geert Delmeiren3-Dec-02 20:24 
GeneralDialogBase Program with no TaskBar Button. Pin
Behzad Ebrahimi2-Dec-02 20:07
Behzad Ebrahimi2-Dec-02 20:07 
GeneralRe: DialogBase Program with no TaskBar Button. Pin
Kannan Kalyanaraman2-Dec-02 20:15
Kannan Kalyanaraman2-Dec-02 20:15 
Generalcannot execute script using IHTMLWindow2 Pin
yourbuddy772-Dec-02 17:23
yourbuddy772-Dec-02 17:23 
GeneralOLE Containers Pin
vijayaramaraju2-Dec-02 17:11
vijayaramaraju2-Dec-02 17:11 
GeneralOLE Containers Pin
vijayaramaraju2-Dec-02 17:10
vijayaramaraju2-Dec-02 17:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.