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. Conversion problem

Conversion problem

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 3 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.
  • S Offline
    S Offline
    Suneet 03
    wrote on last edited by
    #1

    I am using _UNICODE as a directive but want my code to compile without errors without _UNICODE. Can anyone tell me is there any way to switch between functions same way i do for strings #ifdef _UNICODE typedef wchar_t TCHAR; #define __T(x) L ## x #else typedef char TCHAR; #define __T(x) x #endif can i do something same for wcscpy and _tcslen functions. I am using wcscpy in wchar and strcpy for const char*

    R M 2 Replies Last reply
    0
    • S Suneet 03

      I am using _UNICODE as a directive but want my code to compile without errors without _UNICODE. Can anyone tell me is there any way to switch between functions same way i do for strings #ifdef _UNICODE typedef wchar_t TCHAR; #define __T(x) L ## x #else typedef char TCHAR; #define __T(x) x #endif can i do something same for wcscpy and _tcslen functions. I am using wcscpy in wchar and strcpy for const char*

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      You can use _tcscpy which will be either strcpy or wcscpy, depending on _UNICODE.

      http://www.readytogiveup.com/[^] - Do something special today. http://www.totalcoaching.ca/[^] - Give me some feedback about this site !

      1 Reply Last reply
      0
      • S Suneet 03

        I am using _UNICODE as a directive but want my code to compile without errors without _UNICODE. Can anyone tell me is there any way to switch between functions same way i do for strings #ifdef _UNICODE typedef wchar_t TCHAR; #define __T(x) L ## x #else typedef char TCHAR; #define __T(x) x #endif can i do something same for wcscpy and _tcslen functions. I am using wcscpy in wchar and strcpy for const char*

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

        As Rage mentioned....all the CRT string functions have a generic equivelant. Here's a handy chart: Routine Mappings[^]

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

        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