VC++ 2005 Express Problem - Platform SDK Install

Started by
24 comments, last by Koolchamp 17 years, 11 months ago
dam***, its till being stuborn. I put in this code:

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
}

small and simple, but I still get an error:

visual studio 2005\projects\mygodwhenwillitend\mygodwhenwillitend\file1.cpp(6) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast.


Any idea what im doing wrong now?

EDIT: Wait...this is C (I actually read the page this time). I don't know C, I only know C++
Cheers,Ken(Koolchamp)_____________________________"Choose a job you love, and you will never have to work a day in your life." - Confucius"If you don't have a game industry job and you want to go to E3, do what everyone else does. Launch a game review website and call yourself press." - Mike McShaffry(This is true for me) “…..I'm a geek and jocks are my natural enemy.” – Li C. Kuo
Advertisement
Yea there is 2 ways to fix that:

1.
Go to Project -> xxx properties -> Configuration properties -> General
And set Character Set = Not set

2.
Change "Goodbye, cruel world!" to TEXT("Goodbye, cruel world!")

The problem is that windows expect strings to be so called wide character strings by default. The first option will turn that off for the current project.
The second option uses the TEXT macro to convert the string to wide character string

edit: Dont worry about the last error message. Its miss-leading
Suddenly you go quiet :D
I guess we finally nailed it...
Quote:Original post by pulpfist
Suddenly you go quiet :D
I guess we finally nailed it...


I think that was his suicide note [grin]
-----------------------------Language: C++API: Win32, DirectXCompiler: VC++ 2003
I was a bit worried about that too
Well I'll be damn**. It works. pulpfist Thanks for all the help. I appriciate it. And thanks to everyone else who helped.
Cheers,Ken(Koolchamp)_____________________________"Choose a job you love, and you will never have to work a day in your life." - Confucius"If you don't have a game industry job and you want to go to E3, do what everyone else does. Launch a game review website and call yourself press." - Mike McShaffry(This is true for me) “…..I'm a geek and jocks are my natural enemy.” – Li C. Kuo

This topic is closed to new replies.

Advertisement