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 C2664: '_access' : cannot convert parameter 1 from 'TCHAR [260]' to 'const char *'

error C2664: '_access' : cannot convert parameter 1 from 'TCHAR [260]' to 'const char *'

Scheduled Pinned Locked Moved C / C++ / MFC
help
2 Posts 2 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.
  • N Offline
    N Offline
    neha agarwal27
    wrote on last edited by
    #1

    Hi all, Actually i want to find out that particular path exist or not, for that i am using _accessApi. like this

    TCHAR CurrentPath [ MAX_PATH ] ;
    GetTempPath(MAX_PATH, CurrentPath);
    _tcscat(CurrentPath,_T("$insert\\new folder"));

    _access(CurrentPath,NULL);

    but compiler is giving this error error C2664: '_access' : cannot convert parameter 1 from 'TCHAR [260]' to 'const char *' how could i remove this

    C 1 Reply Last reply
    0
    • N neha agarwal27

      Hi all, Actually i want to find out that particular path exist or not, for that i am using _accessApi. like this

      TCHAR CurrentPath [ MAX_PATH ] ;
      GetTempPath(MAX_PATH, CurrentPath);
      _tcscat(CurrentPath,_T("$insert\\new folder"));

      _access(CurrentPath,NULL);

      but compiler is giving this error error C2664: '_access' : cannot convert parameter 1 from 'TCHAR [260]' to 'const char *' how could i remove this

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      You should use _taccess instead (it is also a macro that doesn't depend if UNICODE is declared or not).

      Cédric Moonen Software developer
      Charting control [v1.3]

      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