Sign in to follow this  
mikkowus

C++ express 2005

Recommended Posts

mikkowus    124
Has anyone tried any of the tutorials with VS c++ 2005 express? I'm having a little dificulty with it. When I try any of the tutorials from scratch, I get a whole bunch of errors. The one that I seem to get the most of is as follows c:\documents and settings\1\my documents\visual studio 2005\projects\bla\bla\main.cpp(489) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [42]' to 'LPCWSTR' When I download the completed tutorial, strip it of code etc and use it as a base for other tutorials, it works great. I'm guessing that there is some setting that needs to be changed. I've fooled around for quite a while but unsuccessfully. I'm pretty new to opengl and c++ and any help would be great. If more info is needed, ask away. EDIT: Another error that I'm having trouble with... c:\documents and settings\1\my documents\visual studio 2005\projects\bla\bla\main.cpp(596) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data If I disable that error, all other errors go away but another pops up which reads.. cl : Command line error D8021 : invalid numeric argument '/wdc:\documents' And I have no idea where to go from there.

Share this post


Link to post
Share on other sites
vrok137    241
Well, which tutorial are you using exactly. Are they the ones from MSDN? Usually if you are a beginner, I would recommend to find a tutorial that is "easier" to work off of.

Share this post


Link to post
Share on other sites
vrok137    241
Quote:
Original post by mikkowus
c:\documents and settings\1\my documents\visual studio 2005\projects\bla\bla\main.cpp(489) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [42]' to 'LPCWSTR'


The error I see here looks as if it is coming from the Message box function. Is this error coming from native win32 code or a windows form project?

Share this post


Link to post
Share on other sites
hakabu    124
Quote:
Original post by mikkowus
c:\documents and settings\1\my documents\visual studio 2005\projects\bla\bla\main.cpp(489) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [42]' to 'LPCWSTR'


It seems that you are compiling with Character Set set to Unicode, so MessageBox expect an array of wchar_t, not char, hence the error.
To compile it as it is, go in the properties dialog of the project, go to "General", and change "Character Set" to "Use Multi-byte Character Set".

Share this post


Link to post
Share on other sites
mikkowus    124
Edited my first post... has a little more info.

No, I'm using the tutorials from nehe such as http://nehe.gamedev.net/lesson.asp?index=01

These errors come from any tutorial.

I'm using native win32 code.

Share this post


Link to post
Share on other sites
vrok137    241
Hmm...Your errors seem kind of vague, can you include the source code of your project. I'm working off popsicle sticks and need a better medium to build the foundation.

EDIT: Nevermind, forget what I just said. Make sure you have the platform sdk & the neccesary opengl files also. You can work this two ways. Do what hakabu says, his explanation is more concise.

Share this post


Link to post
Share on other sites
mikkowus    124
thaks a million hakabu! That seems to have fixed the problem. Funny thing is I read that same solution while googling but i guess I changed the setting in the wrong place.

Share this post


Link to post
Share on other sites

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