Tutorial 1 woes
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?
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.
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
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement