• Advertisement
Sign in to follow this  

Help with Evil_Grevens fallingBlocks tutorial...

This topic is 3945 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

Hello, I created both .cpp and the .h files, my 'blocks.bmp' and when I compile, I get these errors...
c:\documents and settings\administrator\my documents\visual studio 2005\projects\fallingblocks\fallingblocks\main.cpp(175) : error C2440: '=' : cannot convert from 'const char [17]' to 'LPCWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\administrator\my documents\visual studio 2005\projects\fallingblocks\fallingblocks\main.cpp(184) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [17]' to 'LPCWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\administrator\my documents\visual studio 2005\projects\fallingblocks\fallingblocks\main.cpp(222) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
c:\documents and settings\administrator\my documents\visual studio 2005\projects\fallingblocks\fallingblocks\main.cpp(239) : error C2664: 'BitMapObject::Load' : cannot convert parameter 2 from 'const char [11]' to 'LPCTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

So any ideas what I did wrong? I'm really new to C++, so I could have made a noobie mistake and not even known it.

Share this post


Link to post
Share on other sites
Advertisement
By default, VC8 works with wide characters. These are two bytes instead of one, to accommodate Unicode characters. The quick and dirty fix involves:

Project=>Properties=>Configuration Properties=>General=>Character Set

Change this to 'Not Set'

The long term fix involves learning to use wide characters and Unicode, but the fix I posted will get the code running.

Share this post


Link to post
Share on other sites
Hey thanks for the reply! It was actually set to 'Use unicode character set'. I changed it to 'Use multi-byte character set' and it compiled great.

I have no idea what that means, but thanks for the help!

Share this post


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

  • Advertisement