December 17th, 2012, 09:18 AM
Code reuse by handling CEdit ON_WM_SETFOCUS handler
In my application I need to to bring up a keyboard dialog when a user clicks any of the edit boxes in the application. Therefore I have OnSetFocus() implemented in all over the application (dialogs) which brings up the keybaord in each of them (which is just another dialog).
I would rather subclass the CEdit control and implement SetFocus() in it and use this class to lend this behavior automatically to all the edit boxes I am using in the application. The problem is that the keyboard dialog is really part of the end dialog, more accurately part of the base class of the end dialog which has the following class hierarchy.
The problem is how can I access the ShowKeyboard() function from the underlying dialog while overriding CEdit::OnSetFocus()? Thanks.
CDialogEx - it implements ShowKeyboard()
CMyDialog - it calls the base ShowKeyboard() to bring up the dialog in OnSetFocus()
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.