Thread: LPTSTR to char*

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

    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.
    Using Windows 10 with Code Blocks and MingW.

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

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    930
    Thank you Bithub!
    Using Windows 10 with Code Blocks and MingW.

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, 08: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, 01: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