Results 1 to 5 of 5

Thread: Unicode LPCTSTR to ANSI CString

  1. #1

    Thread Starter
    Lively Member rabhen's Avatar
    Join Date
    Dec 2001
    Location
    Derby, Derbyshire, UK
    Posts
    79

    Question Unicode LPCTSTR to ANSI CString

    Hi there,
    i am trying to get a Unicode LPCTSTR variable to to display in an EditBox which is CSTRING, at the moment it only displays invalid characters, which makes me think the data is coming in as Unicode. is there anyway to convert between Unicode LPCTSTR and ANSI CString formats?

    i am using eVC++4 writing for a WinCE Barcode Scanner.

    Thanks in Advance...
    R

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    LPCTSTR is not Unicode, it's generic.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Lively Member rabhen's Avatar
    Join Date
    Dec 2001
    Location
    Derby, Derbyshire, UK
    Posts
    79
    i was assuming it was Unicode because i am getting garbage characters from the program.
    i am writing software for a WinCE based Barcode Scanner, i can get the scan to read in data, but it always returns unreadable Data, i jst wondered if it was a problem converting between LPCTSTR and CSTRING...?

    R

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    LPCTSTR is UNICODE if compiled with the UNCIODE symbol defined and ANSI if not. But so is CString, so there shouldn't be any conversion problems. The problem must be nearer to the barcode.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Lively Member rabhen's Avatar
    Join Date
    Dec 2001
    Location
    Derby, Derbyshire, UK
    Posts
    79
    i managed to find something in the Manufacturers (Un)help that pointed me in the right direction, i am pretty sure that i have the problem solved now, thanks for your help...

    R

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width