LPTSTR to char*

This is a discussion on LPTSTR to char* within the C++ Programming forums, part of the General Programming Boards category; Hi! Im trying to cast LPTSTR to char* because i need a char* in another function without much success. I ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    790

    LPTSTR to char*

    Hi!

    Im trying to cast LPTSTR to char* because i need a char* in another function without much success.
    I searched the site and i saw that LPTSTR - is pointer to buffer of TCHAR so its UNICODE.
    So i should turn UNICODE to ASCII maybe?

    Thanks!

    Code:
    LPTSTR pszMem;
    
    cout << (char*)pszMem << endl;
    Last edited by Ducky; 10-30-2009 at 09:35 AM.
    Compiler MSVC++ 2013 with Code::Blocks.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    790
    Thank you Bithub!
    Compiler MSVC++ 2013 with Code::Blocks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. text to LPTSTR?
    By h3ro in forum C++ Programming
    Replies: 9
    Last Post: 08-05-2008, 09:21 AM
  2. Problems with my custom string class
    By cunnus88 in forum C++ Programming
    Replies: 15
    Last Post: 11-15-2005, 07:21 PM
  3. Hot to declare a LPTSTR
    By BianConiglio in forum Windows Programming
    Replies: 3
    Last Post: 07-17-2005, 01:50 PM
  4. sorting a vector of LPTSTR
    By talz13 in forum C++ Programming
    Replies: 2
    Last Post: 03-09-2005, 12:01 PM
  5. MAPI....how to specify FROM email
    By freestyle in forum Windows Programming
    Replies: 0
    Last Post: 05-13-2003, 08:55 AM

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