Link to home
Start Free TrialLog in
Avatar of JensB
JensB

asked on

Text field access in another function

Hello

I got a little routine for checking a date field.
Now i want to automatically set the focus to that field by using f.e:

(where EF_DATUMINDIENST is the name of the text field)
(GetDlgItem(EF_DATUMINDIENST))->SetFocus();

but my idea was of making a function with as param. the name of that text field.

now i set for example a
CString fieldname = "EF_DATUMINDIENST"
and i call the routine here:
DoChecksAndSetFocusAt(fieldname);

but in the routine "DoChecksAndSetFocusAt"
i can't set focus on that control becz it believes it is a CString text

fieldname = result;
UpdateData(FALSE);

This of course doesn't work .. but i have no idea of how to make it work  :(
So i want to access the text field correctly.


Can anyone help me?

Thanks
Jens
ASKER CERTIFIED SOLUTION
Avatar of Priyesh
Priyesh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JensB
JensB

ASKER

ok thanks
i've already found a easier way, just by passing the control id to the function :)
alright, your question made me think that you have to pass the string for some reason. that's why i posted the comment about map.

good luck