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++
VC++ 2005 Express Problem - Platform SDK Install
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
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
Quote:Original post by pulpfist
Suddenly you go quiet :D
I guess we finally nailed it...
I think that was his suicide note [grin]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement