Sign in to follow this  

Lesson 1

This topic is 3832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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? :(

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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