🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Tutorial 1 woes

Started by
4 comments, last by Mike.Popoloski 18 years, 3 months ago
Okay, the topic is misleading since the problem appears to be with my attempts at using VS.net, not the tutorial itself. When I download the lesson and build the project, it compiles fine, but when I try to build the project myself, I get this error: .\nehetutorial1.cpp(80) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [34]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 19 times. Anyone know what setting my version is missing?
Advertisement
Go into Project Settings->General and change the Character Set to Multi-byte. That should fix it.
Thanks! that worked to get rid of those nasty errors. Im getting a warning that the other project did not get:

warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data

on the return line of WinMain:

return (msg.wParam); // Exit The Program

which seems relatively minor, but again, since it differs from the results of the downloaded project I thought I would ask that too. The tutorial works fine so far however.
It's because you're passing an integer as a WPARAM without any specific type casting. Try this line to solve it:
return static_cast<int>(msg.wParam);
Hope that helps ;).
--
Cheers,
Darren Clark
I understand that part, but my concern is that the other version (the one that came complete with the VS workspace) does not appear to generate this warning. On the other hand, the warning is probably a good thing.
If you try a rebuild all on the tutorial project you downloaded, you may get those warnings. If you just hit a normal compile, and there are no errors or changes to the source, the compiler will ignore the warnings.
Mike Popoloski | Journal | SlimDX

This topic is closed to new replies.

Advertisement