I have added the header file, but I can't properly overrider a base class function.
Here's the whole class definition:
Code:
#include "stdafx.h"
#include "Initial GUI.h"
#include "MyEdit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyEdit
CMyEdit::CMyEdit()
{
void CMyEdit::OnSetfocus(CWnd* pOldWnd); //CWnd* pOldWnd
}
CMyEdit::~CMyEdit()
{
}
BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
//{{AFX_MSG_MAP(CMyEdit)
ON_CONTROL_REFLECT(EN_SETFOCUS, OnSetfocus)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyEdit message handlers
void CMyEdit::OnSetfocus(CWnd* pOldWnd) //CWnd* pOldWnd
{
CString lstr, estr, str;
this->selectedEditControl = 1;
CListBox* pGetList = (CListBox*)this->GetParent()->GetDlgItem(IDC_LIST1);
pGetList->GetText((pGetList->GetCurSel()), lstr);
this->SetWindowText(lstr);
}
I get this error
Code:
error C2244: 'CMyEdit::OnSetfocus' : unable to resolve function overload
h:\gui\gui v1\myedit.cpp(37) : error C2511: 'OnSetfocus' : overloaded member function 'void (class CWnd *)' not found in 'CMyEdit'