   Win32 Hello World App problems...
  Yesterday I started to learn Win32 api in C++ because I need it to know before starting learning DirectX, I wrote code from "Introduction to 3D Game Programming with DirectX 9.0" byFrank D. Luna and got 6 errors...Here's the code://2010 - 05 - 01#include <windows.h>HWND MainWindowHandle = 0;bool InitWindowsApp(HINSTANCE instanceHandle,int show);int Run();LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);int WINAPI WinMain(HINSTANCE hInstance,   HINSTANCE hPrevInstance,   PSTR pCmdLine,   int ShowCmd){if(!InitWindowsApp(hInstance,ShowCmd)){::MessageBox(0,"Init - Failed","Error",MB_OK);return 0;}return Run();}bool InitWindowsApp(HINSTANCE instanceHandle,int show){WNDCLASS wc;wc.style = CS_HREDRAW | CS_VREDRAW;wc.lpfnWndProc = WndProc;wc.cbClsExtra = 0;wc.cbWndExtra = 0;wc.hInstance = instanceHandle;wc.hIcon = ::LoadIcon(0,IDI_APPLICATION);wc.hCursor = ::LoadCursor(0,IDC_ARROW);wc.hbrBackground = static_cast<HBRUSH>(::GetStockObject(WHITE_BRUSH));wc.lpszMenuName = 0;wc.lpszClassName = "Hello";if(!::RegisterClass(&wc)){::MessageBox(0,"RegisterClass - Failed",0,0);return false;}MainWindowHandle = ::CreateWindow("Hello","Hello",  WS_OVERLAPPEDWINDOW,  CW_USEDEFAULT,  CW_USEDEFAULT,  CW_USEDEFAULT,  CW_USEDEFAULT,  0,  0,  instanceHandle,  0);if(MainWindowHandle == 0){::MessageBox(0,"CreateWindow - Failed",0,0);return false;::ShowWindow(MainWindowHandle,show);::UpdateWindow(MainWindowHandle);return true;}}int Run(){MSG msg;::ZeroMemory(&msg,sizeof(MSG));while(::GetMessage(&msg,0,0,0)){::TranslateMessage(&msg);::DispatchMessage(&msg);}return msg.wParam;}LRESULT CALLBACK WndProc(HWND windowHandle, UINT msg, WPARAM wParam, LPARAM lParam){switch(msg){case WM_LBUTTONDOWN:::MessageBox(0,"Hello, World","Hello",MB_OK);return 0;case WM_KEYDOWN:if(wParam == VK_ESCAPE)::DestroyWindow(MainWindowHandle);return 0;case WM_DESTROY:::PostQuitMessage(0);return 0;}return ::DefWindowProc(windowHandle,    msg,   wParam,   lParam);}Errors:error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style casterror C2440: '=' : cannot convert from 'const char [6]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [23]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style casterror C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style casterror C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style casterror C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [13]' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castI tried to cast all char pointers, but app didn't worked for me, I really would appreciate your help mates.   
  If you want to use multi-byte chars then include <TCHAR.H>Windows headers use macro's to use diff versions of some routines...if defined unicodedefine MessageBox MessageBoxWelsedefine MessageBox MessageBoxAendifThen you use _T or _TEXT macro for strings...MessageBox(0,_T("RegisterClass - Failed"),0,0);;  have you tried this:L"blabla I'm a string"?;  <link>http://msdn.microsoft.com/en-us/library/e0w9f63b(VS.80).aspx</link>You need to convert the pointer.  I remember dealing with what you are a long time ago.  Nowadays I prefer to let some other library deal with that stuff for me.   ;  What bitshifter said. Or change the project settings from "Unicode" to "Multi Byte Character Set".   ;  I corrected errors using all these things one by one, but every time when i run app, window doesn't show up...   ;if(MainWindowHandle == 0){::MessageBox(0,"CreateWindow - Failed",0,0);return false;::ShowWindow(MainWindowHandle,show);::UpdateWindow(MainWindowHandle);return true;}change the above code to this:if(MainWindowHandle == 0) {::MessageBox(0,"CreateWindow - Failed",0,0);return false;}::ShowWindow(MainWindowHandle,show);::UpdateWindow(MainWindowHandle);return true;;  Thanks Kasya, it work! :)   