Get CEdit control in CDaoRecordView 
Author Message
 Get CEdit control in CDaoRecordView

Hello all,

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--



Sat, 16 Sep 2000 03:00:00 GMT  
 Get CEdit control in CDaoRecordView

I think this is very easy. From your paren window, you call GetFocus which
returns you the window with the current focus. The only thing you have to do
is, that yo must cast from CWnd* to CEdit*.
a member of CWnd:  static CWnd* Pascal GetFocus( );
I hope I helped you
        Michael

PS: If this doesn't work please write me an email.

Ross Bartick schrieb in Nachricht ...

Quote:
>Hello all,

>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--




Sun, 24 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Get CEdit control in CDaoRecordView

2. CDaoRecordView and Tab Control

3. CEdit on top of another CEdit control

4. CEdit box ** CEdit box ** CEdit box

5. Getting the text from CEdit, I need help?

6. Getting the 1st CEdit child of a window

7. Getting int or double from CEdit??

8. Getting selected text from CEdit?

9. Getting the string of a CEdit

10. Getting CEdit box on a Dialog

11. Getting text from external CEdit ...?

12. Trap when CEdit gets focus?

 

 
Powered by phpBB® Forum Software