Sign in to follow this  

[SOLVED]MultiByteToWideChar not displaying properly?

This topic is 4059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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

This topic is 4059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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