UNICODE and windows.h help

This is a discussion on UNICODE and windows.h help within the Windows Programming forums, part of the Platform Specific Boards category; ok...in the windows.h they say if UNICODE is #define then the TCHAR and PTCHAR will be define as WCHAR and ...

  1. #1
    samurai warrior nextus's Avatar
    Join Date
    Nov 2001
    Posts
    196

    UNICODE and windows.h help

    ok...in the windows.h they say if UNICODE is #define then the TCHAR and PTCHAR will be define as WCHAR and WCHAR*, and if it is not defined then TCHAR and PTCHAR will be define as char and char*..so if i include the windows.h header file under it do i have to put #define UNICODE for it to be unicode

    like so
    [code]
    #include <windows.h>
    #define UNICODE
    //this is for it to be UNICODE
    [/code[

    Code:
    #include <windows.h>
    //this is ASCII or is this ANSI..still need explanation
    thanks for help
    nextus, the samurai warrior

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    I always put the define before the header...and also define "_UNICODE" as well....some conditional compilations use that too

  3. #3
    samurai warrior nextus's Avatar
    Join Date
    Nov 2001
    Posts
    196
    ok then i did this

    Code:
    #define UNICODE
    #define _UNICODE
    #include <window.h>
    #include <iostream>
    
    int main()
    {
    PTCHAR a = "happy";
    return 0;
    }
    it's giving me an error for the assignment statement..any helps? it says trying to store an array into an usigned short*
    nextus, the samurai warrior

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Try

    PTCHAR a = TEXT("happy");

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems reading windows.h
    By yaya in forum Windows Programming
    Replies: 7
    Last Post: 05-22-2009, 03:33 PM
  2. windows.h????
    By verbity in forum Game Programming
    Replies: 4
    Last Post: 01-01-2007, 11:27 AM
  3. windows.h no such file or directory
    By FingerPrint in forum Tech Board
    Replies: 11
    Last Post: 08-26-2006, 10:51 PM
  4. windows.h
    By h_howee in forum C++ Programming
    Replies: 2
    Last Post: 05-05-2006, 11:52 PM
  5. windows.h without the mouse support
    By ()Q() in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2002, 08:57 PM

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