Salut
Un lucru nu il inteleg, cand pun aceasta linie de cod:
TRACE0("\n CCustomEdit::OnGetDlgCode");
UINT nDefDlgCode = CEdit::OnGetDlgCode(); // default value
UINT nCustomDlgCode = nDefDlgCode | DLGC_WANTALLKEYS; // wants all keys
imi zice :
probdlg.cpp(380): error C2248: 'CWnd::OnGetDlgCode' : cannot access protected member declared in class 'CWnd'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3016) : see declaration of 'CWnd::OnGetDlgCode'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2273) : see declaration of 'CWnd'
probdlg.cpp(380): error C2352: 'CWnd::OnGetDlgCode' : illegal call of non-static member function
1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3016) : see declaration of 'CWnd::OnGetDlgCode'
Eroarea este la CEdit:: ....
Eroare la CEdit::OnGetDlgCode
- Ovidiu Cucu
- Fondator
- Posts: 3778
- Joined: 11 Jul 2007, 16:10
- Judet: Iaşi
- Location: Iasi
- Contact:
Re: Eroare la CEdit::OnGetDlgCode
Inseamna ca acel cod nu-i nici in clasa CEdit, nici intr-o clasa derivata din CEdit.
Ovidiu
Follow http://twitter.com/#!/ovidiucucu
Weblog: http://codexpert.ro/blog/author/ovidiu-cucu/
Visit FAQ, Tips & Tricks
Follow http://twitter.com/#!/ovidiucucu
Weblog: http://codexpert.ro/blog/author/ovidiu-cucu/
Visit FAQ, Tips & Tricks
- Marius Bancila
- Fondator
- Posts: 2344
- Joined: 11 Jul 2007, 11:45
- Judet: Timiş
- Location: Timisoara
- Contact:
Re: Eroare la CEdit::OnGetDlgCode
Code: Select all
UINT nDefDlgCode = CEdit::OnGetDlgCode(); // default value
Ce vrei tu de fapt sa faci e sa tratezi acest mesaj in clasa ta.
Adaugi asta in header
Code: Select all
afx_msg UINT OnGetDlgCode();
Code: Select all
ON_WM_GETDLGCODE()
Code: Select all
UINT ClasaTa::OnGetDlgCode()
{
return DLGC_WANTALLKEYS;
}
Update: se pare ca am bagat o eroare, OnGetDlgCode() e o metoda protected din CWnd, deci e accesibila din CEdit.