Sign in to follow this  
BUnzaga

Help with Evil_Grevens fallingBlocks tutorial...

Recommended Posts

BUnzaga    267
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
Dranith    504
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
BUnzaga    267
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

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