Fixing Wierd Problems
Here's an odd compiler error that I got today while working on a directx sample:
x:\ssargent\projects\introdirectx\chap01\d3dinit.cpp(84) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char ' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Now it turns out this is an error thats partially caused by Visual Studio 2005. I don't claim to know which is better but apparently code that was written in vs2003 might expect a multi byte character set while VS 2005 defaults to a Unicode character set. This little error is caused by that difference. To fix it in vs2005 just switch to a multibyte character set. Right Click on Project -> Properties -> General -> Character set. This fixed it for me, perhaps this will help some others. This was also in this thread: http://www.moon-labs.com/cgi-bin/YaBB/YaBB.cgi?board=book_board;action=display;num=1135734768