Jump to content

  • Log In with Google      Sign In   
  • Create Account


lesson 1


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 lotrfan1405   Members   -  Reputation: 122

Like
0Likes
Like

Posted 15 April 2006 - 05:44 AM

Hi, I'm trying to do the openGl tutorials. But I get the following errors ------ Build started: Project: NeHe OpenGl tutorial, Configuration: Debug Win32 ------ Compiling... Lesson1.cpp c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(74) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(79) : 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 c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(86) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [31]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(92) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(96) : error C2664: 'UnregisterClassW' : cannot convert parameter 1 from 'const char [7]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(98) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(134) : error C2440: '=' : cannot convert from 'const char [7]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(138) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [37]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(156) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [94]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(163) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(196) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(199) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [23]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(228) : 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 c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(235) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [35]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(242) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [27]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(249) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [37]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(256) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [41]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(268) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [23]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(345) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [42]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\user\desktop\lotrfan1405\c++\nehe opengl tutorial\nehe opengl tutorial\lesson1.cpp(402) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data Build log was saved at "file://c:\Documents and Settings\user\Desktop\lotrfan1405\C++\NeHe OpenGl tutorial\NeHe OpenGl tutorial\Debug\BuildLog.htm" NeHe OpenGl tutorial - 19 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== And the code won't compile? [Edited by - lotrfan1405 on April 15, 2006 4:34:41 PM]

Sponsor:

#2 lotrfan1405   Members   -  Reputation: 122

Like
0Likes
Like

Posted 15 April 2006 - 10:46 AM

Does anybody know why this is?

#3 jonahrowley   Members   -  Reputation: 300

Like
0Likes
Like

Posted 15 April 2006 - 11:07 AM

It wants wide strings, but you're passing it normal character arrays.

Project -> Properties -> Configuration Properties -> General -> Character Set

Set that setting to Use Multi-Byte Character Set

#4 lotrfan1405   Members   -  Reputation: 122

Like
0Likes
Like

Posted 17 April 2006 - 01:56 PM

Thank you so much!

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

0Likes

Posted 25 April 2006 - 11:07 AM

another thing is to put TEXT( ) around the texts.
"Blablub" -> TEXT("BlaBlub")

this should also solve the problem

#6 nova9   Members   -  Reputation: 122

Like
0Likes
Like

Posted 04 May 2006 - 11:36 AM

please don't use TEXT unless absolutely necessary.

use the short version _T("whatever")

and for unicode you can use L"whatever"

#7 SMcNeil   Members   -  Reputation: 139

Like
0Likes
Like

Posted 04 May 2006 - 11:55 AM

This bring up a question that I have been trying to understand.
What is the diffrence between doing TEXT("..."), _T("...") and L"..."?
I thought they were the same thing. (?)

Thanks,

Sabrina.

[Edited by - SMcNeil on May 4, 2006 6:55:03 PM]

#8 chollida1   Members   -  Reputation: 532

Like
0Likes
Like

Posted 04 May 2006 - 12:00 PM

Quote:
Original post by nova9
please don't use TEXT unless absolutely necessary.

use the short version _T("whatever")

and for unicode you can use L"whatever"


why??

Cheers
Chris

#9 nova9   Members   -  Reputation: 122

Like
0Likes
Like

Posted 04 May 2006 - 12:25 PM

quote
WINDOWS.H defines a macro called TEXT() that will mark string literals as Unicode, depending on whether the UNICODE compile flag is set.

#ifdef UNICODE
#define TEXT(string) L#string
#else
#define TEXT(string) string
#endif // UNICODE
/quote

just because _T("hi") takes up less space.

if you don't need to support windows9x or win9x users without MSLU just use L"hi" for unicode, only.

and if win9x users complain tell them to install MSLU to get unicode support
http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx
(as long as your project has implemented MSLU support)

[Edited by - nova9 on May 5, 2006 6:25:07 PM]

#10 chollida1   Members   -  Reputation: 532

Like
0Likes
Like

Posted 05 May 2006 - 03:56 AM

so your whole post of "please don't use TEXT unless absolutely necessary." is based on TEXT being 2 characters longer than _T?? Being a lisp programmer I respect your concern for making your code dense:)

Cheers
Chris

#11 chollida1   Members   -  Reputation: 532

Like
0Likes
Like

Posted 05 May 2006 - 03:56 AM

so your whole post of "please don't use TEXT unless absolutely necessary." is based on TEXT being 2 characters longer than _T?? Being a lisp programmer I respect your concern for making your code dense:)

Cheers
Chris




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS