I am working on an MFC/DAO application. My CDaoRecordViews have a few CEdit
controls which allow me to edit my Database Tables.
I need to get a reference to the CEdit control which has the focus. I cannot
figure out how this is done. I want to put this code in my generic parent
class so I do not want to hardcode any dialog ids in the solution. I just
need a way to get a pointer/reference to the CEdit control which has the
focus.
Does anyone have any ideas?
Thanks,
--Ross--
rbar...@i-2000.com
Where pView is a pointer to the current CDaoRecordView class.
Ross Bartick <rbar...@i-2000.com> wrote in article
<eJyfW7Y...@uppssnewspub05.moswest.msn.net>...
Thanks John. Your solution looks great.
--Ross--
>"John Cornell" wrote:
>How about:
> CEdit* pEdit = ((CEdit*)(pView->m_hWnd.GetFocus()));
>
>Where pView is a pointer to the current CDaoRecordView class.
>>Ross Bartick <rbar...@i-2000.com> wrote in article
>> I need to get a reference to the CEdit control which has the focus.
The above line will not work. It needs to be written as follows:
CEdit* pEdit = ((CEdit*)(FromHandle(pView->m_hWnd)->GetFocus()));
--Ross--