How to convert a CString object to integer in MFC.
CString
You may use the C atoi function ( in a try / catch clause because the conversion isn't always possible) But there's nothing in the MFC classes to do it better.