Turn off unicode in MSVC++ Express 2005

This is a discussion on Turn off unicode in MSVC++ Express 2005 within the C++ Programming forums, part of the General Programming Boards category; Functions like CreateFile are defined to the unicode versions if UNICODE is defined otherwise they are ANSI versions. I've been ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    847

    Turn off unicode in MSVC++ Express 2005

    Functions like CreateFile are defined to the unicode versions if UNICODE is defined otherwise they are ANSI versions.

    I've been using the ANSI versions but now I've created a new project and suddenly they are set to the unicode versions so my code breaks.

    I've even tried placing an #undef UNICODE before a function call but I still get the error about the arguments not being the correct type.

    Is there some project setting for this?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Look in the predefined macros for _UNICODE and UNICODE. Also look for some option saying "Use UNICODE" or something like that.
    With VC++8 MS finally made UNICODE compilation the default, which is good, because only WinME doesn't support it, and all NT-based are faster with UNICODE.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Quote Originally Posted by CornedBee
    With VC++8 MS finally made UNICODE compilation the default, which is good, because only WinME doesn't support it, and all NT-based are faster with UNICODE.
    I didn't know that unicode is faster, maybe I should just stick with unicde then.
    I found the setting in project->properties->general->charactor set.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    WinNT and derivates all use Unicode internally. Whenever you call an ANSI method there, it converts the text to Unicode, calls the Unicode version, and converts the result back. That's why Unicode is faster.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VS 2008 Express with 2005 PSDK
    By Mario F. in forum Tech Board
    Replies: 2
    Last Post: 10-11-2008, 12:29 PM
  2. Linker errors with 2005 Express
    By thetinman in forum Windows Programming
    Replies: 4
    Last Post: 12-30-2006, 08:04 AM
  3. Help: Microsoft Visual Basic 2005 Express Editon
    By karlawarla in forum Windows Programming
    Replies: 5
    Last Post: 11-22-2006, 01:46 PM
  4. Visual C++ 2005 Express Edition
    By BestGameMovie in forum C++ Programming
    Replies: 6
    Last Post: 05-15-2005, 01:49 PM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21