Convert MFC CString to integer

rahul picture rahul · Jun 14, 2009 · Viewed 137.7k times · Source

How to convert a CString object to integer in MFC.

Answer

Vladimir Kocjancic picture Vladimir Kocjancic · Jun 24, 2010

If you are using TCHAR.H routine (implicitly, or explicitly), be sure you use _ttoi() function, so that it compiles for both Unicode and ANSI compilations.

More details: https://msdn.microsoft.com/en-us/library/yd5xkb5c.aspx