Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to convert CString to int in UNICODE app?

How to convert CString to int in UNICODE app?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TooShy2Talk
    wrote on last edited by
    #1

    Hi again, Now that I'm using UNICODE app, I'm having an error when I tried to convert CString to int using atoi. How can I convert CString to int in UNICODE app? Hope you can comment thank you.

    H M T 3 Replies Last reply
    0
    • T TooShy2Talk

      Hi again, Now that I'm using UNICODE app, I'm having an error when I tried to convert CString to int using atoi. How can I convert CString to int in UNICODE app? Hope you can comment thank you.

      H Offline
      H Offline
      Haroon Sarwar
      wrote on last edited by
      #2

      wtoi?

      1 Reply Last reply
      0
      • T TooShy2Talk

        Hi again, Now that I'm using UNICODE app, I'm having an error when I tried to convert CString to int using atoi. How can I convert CString to int in UNICODE app? Hope you can comment thank you.

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        or better yet, use the generic char types (TCHAR) and your code will compile for both Unicode and non-Unicode builds. Using Generic Text Mappings[^] _tstoi() is the generic char function for atoi(). Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        1 Reply Last reply
        0
        • T TooShy2Talk

          Hi again, Now that I'm using UNICODE app, I'm having an error when I tried to convert CString to int using atoi. How can I convert CString to int in UNICODE app? Hope you can comment thank you.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          TooShy2Talk wrote:

          Now that I'm using UNICODE app, I'm having an error when I tried to convert CString to int using atoi. How can I convert CString to int in UNICODE app?

          use generic text mapping function _ttoi

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
          Never mind - my own stupidity is the source of every "problem" - Mixture

          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups