what are TCHAR's & _tcscpy?

This is a discussion on what are TCHAR's & _tcscpy? within the C++ Programming forums, part of the General Programming Boards category; Hi I'm trying to get a class function to work, the function is; CD3DFont::CD3DFont ( TCHAR * strFontName, DWORD dwHeight, ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    23

    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.

    http://dxframework.sourceforge.net/d...pp-source.html

    Thanks

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,650
    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.

    gg

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    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, 04: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

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