#ifdef _WIN32
#include <windows.h>
#endif
#include <iostream>
#include <vector>
#include <string>
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>

using std::vector;

void error(const std::string& s) {
#ifdef _WIN32
	MessageBox(NULL, s.c_str(), "An error occurred", MB_ICONINFORMATION | MB_OK);
#else
	std::cerr << s << std::endl;
#endif
}

That's my problem...

1>------ Build started: Project: glut_1, Configuration: Debug Win32 ------
1>  main.cpp
1>c:\users\konnor\documents\visual studio 2010\projects\glut_1\glut_1\main.cpp(15): error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And there's the error. Not sure what to do. Thanks in advance.

Recommended Answers

You working with a project where
#define UNICODE
is defined ,

If you want to continue with your UNICODE way, then I suggest you to typecast
your asci to unicode.

use any trick in here,
http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/0f749fd8-8a43-4580-b54b-fbf964d68375

Jump to Post

All 2 Replies

You working with a project where
#define UNICODE
is defined ,

If you want to continue with your UNICODE way, then I suggest you to typecast
your asci to unicode.

use any trick in here,
http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/0f749fd8-8a43-4580-b54b-fbf964d68375

Alright, so don't really know what the differences between multi-byte code and unicode. How do i make it work? I looked over the last post and It just flew right over my head.
Thank you very much for the response though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.