• Advertisement
Sign in to follow this  

Lesson 1

This topic is 3905 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
Advertisement
Compile without Unicode, if you're using VC2005 it's under general project settings (I think).

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
Sign in to follow this  

  • Advertisement