Jump to content
  • Advertisement
Sign in to follow this  
mattnenterprise

Win32

This topic is 3434 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 was wondering if anyone knew of a good Win32 tutorial.I've tried Forger's and FunctionX but the code will not work with my compiler.Which is Visual C++ 2008 Express Edition.

Share this post


Link to post
Share on other sites
Advertisement
theForger's code should definitely work with Visual Studio 2008 Express. If it doesn't, there is probably something wrong with how you have the project set up. Unless you find out what is wrong, no tutorial will be able to help you (and IMO, theForger's is the best tutorial I've come across anyway). What errors are you getting?

Share this post


Link to post
Share on other sites
Without getting the complete error message, I'm not sure exactly what the problem is, but there is a common pitfall with this sort of thing that you should know about.

There are many different ways that computers encode characters. You probably know about the traditional 8-bit char data type. There is another, that is often not mentioned in programming books and tutorials, called wchar_t. This is for "wide characters", i.e. characters that use more than 8 bits. The size of a wchar_t depends on your compiler. If you're making a Win32 program, then it's probably 16 bits and uses UTF-16 encoding.

What is (probably) happening is that you're using strings literals in the traditional char format, but the functions and macros like MessageBox() are expecting a wide character format. The reason they are expecting a wide character format is (ultimately) because your project is set up that way (it is the default).

For more information on characters and stuff, I recommend the following article:

http://www.joelonsoftware.com/articles/Unicode.html

Anyway, the short answer to your problem (probably), is to click on Project > ProjectName Properties, then select General under Configuration Properties, and change the Character Set option to "Use Multi-Byte Character Set".

Share this post


Link to post
Share on other sites
Quote:
Original post by CDProp
Anyway, the short answer to your problem (probably), is to click on Project > ProjectName Properties, then select General under Configuration Properties, and change the Character Set option to "Use Multi-Byte Character Set".

Um, no. The short answer is to learn to use Unicode, and to wrap all text literals being passed to Win32 in the TEXT() macro.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!