This is probably a pretty basic question, but I can't seem to get it. I am working on a visualC++ project and I basically want to get a string from a GUI and then use that as a filename. I have written the following thus far, where IDC_FILE_NAME is the ID of the edit control box but I'm not sure if that is even the way to accomplish this.
m_pFileName = (CEdit*)GetDlgItem( IDC_FILE_NAME );
CString fName =_T(" ");
GetDlgItemTextA(IDC_FILE_NAME, fName);
The answer is YES and NO. YES if properly used, NO, not as you do it. Do not use UNICLODE/ANSI specific versions of functions unless you want to force UNICODE or ANSI. Your code should look like:
NOTE GetDlgItemText