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. ERROR '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *'

ERROR '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *'

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
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.
  • P Offline
    P Offline
    Purish Dwivedi
    wrote on last edited by
    #1

    This is my code segment. CString timestamp; int year = _atoi64((LPCTSTR)timestamp.Left(4)); I am getting an error like '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *' How can I remove it? Thanks.

    _ 1 Reply Last reply
    0
    • P Purish Dwivedi

      This is my code segment. CString timestamp; int year = _atoi64((LPCTSTR)timestamp.Left(4)); I am getting an error like '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *' How can I remove it? Thanks.

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      P T R 3 Replies Last reply
      0
      • _ _AnsHUMAN_

        try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

        P Offline
        P Offline
        Purish Dwivedi
        wrote on last edited by
        #3

        Thanks Anshuman, It worked for me.

        1 Reply Last reply
        0
        • _ _AnsHUMAN_

          try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

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

          BTW, the static_cast<lpctstr>() is useless and can be omitted

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

          1 Reply Last reply
          0
          • _ _AnsHUMAN_

            try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            _AnsHUMAN_ wrote:

            try _ttoi(static_cast(timestamp.Left(4)));

            Just adding to toxcct's reply, CString has the LPCTSTR operator!

            It is a crappy thing, but it's life -^ Carlo Pallini

            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