Thread: what are TCHAR's & _tcscpy?

  1. #1
    Registered User
    Join Date
    Aug 2003

    what are TCHAR's & _tcscpy?

    Hi I'm trying to get a class function to work, the function is;

    CD3DFont::CD3DFont ( TCHAR * strFontName,
    DWORD dwHeight,
    DWORD dwFlags = 0L

    The problem is when I try to use it I get something about a "long" or unsigned long error. But when I copy the whole class into my main cpp, instead of having it as an include, it works ok. The next bit in the function is;

    _tcscpy( m_strFontName, strFontName );

    I think this might be what the problem is, I looked up _tcscpy and I think it copies something like a const char to a char, is there any way around this, is there char function that will do it with out the const bit? I don't know what the problem is otherwise.
    This is the file if any one wants to see it.


  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    TCHAR is an abstract type that can be either a char or wchar_t depending on if you have UNICODE defined or not.

    Don't use TCHAR, use char and strcpy() and the likes.


  3. #3
    Registered User
    Join Date
    Nov 2002
    std::string was created for a reason, use it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. why do my TCHARS change size?!
    By reanimated in forum C++ Programming
    Replies: 5
    Last Post: 01-12-2004, 05:52 AM
  2. trying to get basic_ostream template to use TCHARs
    By Dang in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2001, 07:04 PM