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 _TCHAR* to long

How to convert _TCHAR* to long

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialcareer
5 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.
  • M Offline
    M Offline
    manju 123
    wrote on last edited by
    #1

    Hi... Can anyone tell me hoe to convert _TCHAR* to long.. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ _TCHAR *csTest; I want to convert it to long.. plz help me thank you manju

    Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

    M D 2 Replies Last reply
    0
    • M manju 123

      Hi... Can anyone tell me hoe to convert _TCHAR* to long.. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ _TCHAR *csTest; I want to convert it to long.. plz help me thank you manju

      Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

      M Offline
      M Offline
      manish patel
      wrote on last edited by
      #2

      See into msdn for

      atol, _atol_l, _wtol, _wtol_l

      functions. Is this you want?

      Manish Patel. B.E. - Information Technology.

      M 1 Reply Last reply
      0
      • M manju 123

        Hi... Can anyone tell me hoe to convert _TCHAR* to long.. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ _TCHAR *csTest; I want to convert it to long.. plz help me thank you manju

        Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

        D Offline
        D Offline
        Dominik Reichl
        wrote on last edited by
        #3

        TCHAR *csTest = ...;
        long lValue = _tcstol(csTest, NULL, 10);


        Too many passwords to remember? Try KeePass Password Safe!

        1 Reply Last reply
        0
        • M manish patel

          See into msdn for

          atol, _atol_l, _wtol, _wtol_l

          functions. Is this you want?

          Manish Patel. B.E. - Information Technology.

          M Offline
          M Offline
          manish patel
          wrote on last edited by
          #4

          You can use this also: TCHAR *x = "1252655"; long val; sscanf(x, "%ld", &val);

          Manish Patel. B.E. - Information Technology.

          T 1 Reply Last reply
          0
          • M manish patel

            You can use this also: TCHAR *x = "1252655"; long val; sscanf(x, "%ld", &val);

            Manish Patel. B.E. - Information Technology.

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            you should certainly learn what a TCHAR is. your code has 50% of chances to crash.

            manish.patel wrote:

            TCHAR *x = "1252655";

            TCHAR* x = _T("1252655");

            manish.patel wrote:

            sscanf()

            WTF ! sscanf() is not TCHAR aware... it handles only ansi strings

            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            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