If you are using a dialogue then you can use the GetDlgItemText function.

Also you can use the string class (much easier to manipulate with the string).