🎉 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!

Lesson 1

Started by
2 comments, last by dreamtwister 17 years ago
Hi there, Ive started your OpenGL lessons (which seem to be great btw :D), but ive come accross an error when i try to compile Lesson 1 written by myself: error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR' Concerning the line MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION); The same error occurs for all the MessageBox calls in the code. The wierd thing is if i load your project in to Visual C++, then copy over my version of Lesson1.cpp and compile it, it works perfectly with no errors at all. Any idea how to fix it for my project? :(
Advertisement
Compile without Unicode, if you're using VC2005 it's under general project settings (I think).
That fixed it, Thanks a lot! :D
You could also modify

MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);


To

MessageBox(NULL,L"Release Of DC And RC Failed.",L"SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);


The 'L' tells the compiler to treat your string as wide characters.

This topic is closed to new replies.

Advertisement