Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading ANSI string from UNICODE app.

Status
Not open for further replies.

WilliamGS

Programmer
Jan 21, 2004
54
PE
Hello everybody.
I have to read a string from registry, this string is ANSI, when I read it with ANSI version of my app, all is fine, but if I read it with UNICODE version of my app, the string obtained is wrong, so, how can I read a ANSI string (from registry) from a UNICODE app?.

Thansk in advance,
William GS
 
Although I haven't run into such problems ever, but I think that registry strings are all unicode "in nature". Could it be, that you expect an ANSI string when calling a Unicode API function? I think you should get a Unicode string, and then do the conversion to ANSI string if needed.

Btw, this is just a try to solve this. I might be wrong on assumptions I made for the exact problem you're having.

------------------
When you do it, do it right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top