This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Unicode string handling, or not...


Unicode string handling, or not...

Postby ZaG » Dec 26, 2002 @ 4:03pm

Ok, I'm a little confused about the best way to do what I want to do. I have a text file on my pocket pc that has something in it like this:

[Hello]

I want to read this text into a variable and than parse out the Hello part of it. Then I'm using gapidraw's DrawText function to write it out on the screen.

I originally had 2 variables defined like this:

char mytempstr[20];
char mystr[20];

I used fscanf to read the string into mytempstr and then did some parsing on it and ended up with "Hello" in mystr. Now I want to be able to pass it to Gapidraw's DrawText but it takes a TCHAR* as the string to display. What do I need to do to convert my string so I can pass it to DrawText as a TCHAR* instead of the current single-byte string?

I tried doing this:
TCHAR msg[256];
_stprintf(msg, TEXT("%s"), myStr);

and then passing msg to DrawText but it just displays every other character in the string.

I'm running this on both my pocket pc and my desktop pc and it works fine on my desktop but doesn't work on the pocket pc. How can I make it work on both?
Thanks,
ZaG
User avatar
ZaG
pm Member
 
Posts: 31
Joined: Nov 21, 2002 @ 7:43pm


Postby Digby » Dec 26, 2002 @ 9:34pm

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum