Dev-C++ / Visual Studio --- Why wont it work?
Good Evening!
I have some trouble trying to creata a simple window (I have only been doing console apps before).
Well, so I learned how to make this window and this is the source code that I'm using:
http://www.alsprogrammingresource.com/basic_window_source.html
But it will only work for me in Dev-C++ and not in Visual Studio 2005. Why is that? Is there anything I can do to make it work in Visual Studio?
When I try to compile this in Visual Studio I get 4 errors and 1 warning:
: error C2440: '=' : cannot convert from 'const char [16]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
: 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
: error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [16]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
: 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
: warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
Looks like your version of VC is set to use multi-byte / wide characters( characters larger than 1 byte ). For the windows API, functions ending with W use wide characters and functions ending with A uses plain ASCII. Win32 functions without either(like just "MessageBox") will use whichever one the compiler is set to.
You'll have to toy around with your project or compiler settings in VC to set it to use plain ASCII.
You'll have to toy around with your project or compiler settings in VC to set it to use plain ASCII.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement