   Win32 question.
  I get an error on compiling my source :'( idk what i'm doing wrong i'm using msvc++ .netheres my source#include <windows.h>const char appname[] = "cory";bool done = false;LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam){switch(iMsg){case WM_DESTROY:PostQuitMessage(0);done = true;break;}return DefWindowProc(hwnd,iMsg,wParam,lParam);}int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpInstance, PSTR cmdLine, int iCmd){WNDCLASS wc;wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);wc.cbClsExtra = NULL;wc.cbWndExtra = NULL;wc.hCursor = LoadCursor(NULL,IDC_ARROW);wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);wc.hInstance = hInstance;wc.lpfnWndProc = WndProc;wc.lpszClassName = appname;wc.lpszMenuName = NULL;wc.style = CS_OWNDC;RegisterClass(&wc);HWND hwnd = CreateWindow(appname,"window",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,   CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,   NULL,   NULL,hInstance,NULL);UpdateWindow(hwnd);ShowWindow(hwnd,iCmd);MSG msg;while(!done){if(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}}return 0;}heres the errors:------ Rebuild All started: Project: Hack2, Configuration: Debug Win32 ------Deleting intermediate and output files for project 'Hack2', configuration 'Debug|Win32'Compiling...main.cppc:\documents and settings\cory fisher\my documents\visual studio 2005\projects\hack2\hack2\main.cpp(22) : error C2440: '=' : cannot convert from 'const char [5]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castc:\documents and settings\cory fisher\my documents\visual studio 2005\projects\hack2\hack2\main.cpp(36) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castBuild log was saved at "file://c:\Documents and Settings\Cory Fisher\My Documents\Visual Studio 2005\Projects\Hack2\Hack2\Debug\BuildLog.htm"Hack2 - 2 error(s), 0 warning(s)========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========any help is appreciated.   
  Looks like a unicode problem.. That is, you are trying to pass a c-style string with 8-bit chars to a function requireing a string with 16 bits per char..To fix, I think you're supposed to use wchar_t instead of char..const wchar_t appname[] = "cory";might work, otherwise you could tryconst wchar_t appname[] = L"cory";You could also turn off unicode somewhere in your project (change from unicode to multibyte string).. This is probably easier, and more compatible with tutorials, but if you can live with it, you should probably try with unicode..   ;  Your application is configured to use Unicode, which uses 2-byte (a.k.a "wide") characters. You have a choice:Reconfigure your application and turn off Unicode. Sorry, I don't know how to do that off-hand.Change your strings into Unicode strings using the _T() macro (probably the best way if you want to be able to switch) or use the 'L' prefix on your strings. (Note that the standard C string functions don't work with Unicode strings.) For example, you would change the appname string to this:TCHAR const appname[] = _T("cory"); or    TCHAR const appname[] = L"cory";  ;  how do i turn off unicode??? i have Microsoft Visual Studio 2005i'm so lost lmao;  Right click on your project (not your solution) properties, then Configuration properties, then on the right you got "project defaults" and last: " Character Set" Choose whatever is suitable :)BTW, if you dont mind me sneaking a related question into you thread :)I'm spending extra efforts to use unicode character set in every piece of my project in order to anticipate localization in japaneese. Is that really necessary or am I wasting efforts ?   ;  I think you have to use unicode to support japaneese, and honestly, you might just need it for other languages as well (swedish f.e). There are tons of games where I can't chat in my native language, and it annoys me to death each time. :p   ;  Adding in unicode support later is a pain, trust me.OP: Seriously you need to use enter a bit more and check return states (white space does not increase compile times hehe).  RegisterClass() should be checked for errors, same with CreateWindow.  You just assume it all works but what if you have issues.  Adding in these checks earlier makes it easier later.   ;Quote:Original post by GotenRulezUhow do i turn off unicode??? i have Microsoft Visual Studio 2005i'm so lost lmaou can also #undef UNICODE before your #include<windows.h> statement (preferably in a precompiled header if u do this though).   