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_DATUMINDIEN ST))->SetF ocus();
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(fiel dname);
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
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_DATUMINDIEN
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(fiel
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
good luck
ASKER
i've already found a easier way, just by passing the control id to the function :)