Sign in to follow this  
ChaosPhoenix

[SOLVED]MultiByteToWideChar not displaying properly?

Recommended Posts

ChaosPhoenix    242
I've run into a bit of an interesting problem. I work on 2 PCs; one with an install of Visual C++ Express 2005, and the other with Visual Studio .NET 2003. I worked all day on a project using the VC Express compiler and things were working perfectly. I take it home to my visual studio .NET compiler and now all my console text that I use "MultiByteToWideChar" to format is showing up as missing characters or random symbols. I'm using WriteConsole which requires a WCHAR string, so I wrote conversion functions and all was well. However, I cannot figure out why the .NET compiler is weirding out over the MultiByteToWideChar function. It seems any text formatted by that function, on this machine, causes corrupt text. Maybe it's just something as simple as a project setting, but I'm out of ideas. Here is the text working correctly: Here it is on the .NET 2003 compiler: [Edited by - ChaosPhoenix on November 6, 2006 5:28:24 PM]

Share this post


Link to post
Share on other sites
ChaosPhoenix    242
Quote:
Original post by Paulius Maruska
Can't say for sure, but i think VS2003 defaulted to ANSI, and VS2005 defaults to Unicode.
Just try to define UNICODE and _UNICODE (globally in your project settings).


Worked perfectly. Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this