basic dialog

hey i tried to make a basic program with just an windows and an message,but when i try to compile it in Microsoft Visual Studio I get a failed error:[code]c:documents and settings...noikmijn documentenvisual studio 2005projectsasics est1 est1main.cpp(25) : error C2664: 'MessageBoxW': cannot convert parameter 2 from 'const char [11]' to 'LPCWSTR'[/code]

but when i compile it in devc++ it works fine, what am i doing wrong in the M$ program??

Hi, At a guess you are using Visual Studio 2005 - the projects this version creates generates code in UNICODE but your string literal you are passing to the messagebox function is deemed to be the standard char array. The clue is given in the warning about MessageBoxW (the W bit being the important one). MessageBox function actually gets mapped to one of two functions depending on the UNICODE setting. MessageBoxA for standard char strings and MessageBoxW for unicode strings. The best way to get around this is to surround all your string literals with:[b]TEXT("[color=Red]your string goes here[/color]"). [/b]This means that if, later, you code for char-type strings, it will still work.

Incidentally, if you convert a project from one character representation to another without using the wizard, you may come up with an entry-point error. You may have to set the entry point ([italic]Properties::Linker::Advanced::Entry Point[/italic]) to [color=Blue][b]wWinMainCRTStartup[/b][/color] for UNICODE and blank for MBCS/Not Set.