Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

problems getting started

Hi!
I'm a beginner in win32 programming. I have installed on my PC visual studio 2005 standard edition, I found great tutorials on this subject. The only problem I have is that I can't compile one single piece of code without getting errors like these:
'MessageBoxW' : cannot convert parameter 2 from 'const char [8]' to 'LPCWSTR'
'CreateWindowExW' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'
I opened a new project, chosen "win32 Project", then "windows application", empty project. I saved the source file asa a .cpp file.
Please tell me what I'm doing wrong. Thanks!

Comments

  • MT2002MT2002 Member Posts: 1,444
    : Hi!
    : I'm a beginner in win32 programming. I have installed on my PC
    : visual studio 2005 standard edition, I found great tutorials on this
    : subject. The only problem I have is that I can't compile one single
    : piece of code without getting errors like these:
    : 'MessageBoxW' : cannot convert parameter 2 from 'const char [8]' to
    : 'LPCWSTR'
    : 'CreateWindowExW' : cannot convert parameter 2 from 'const char
    : [14]' to 'LPCWSTR'
    : I opened a new project, chosen "win32 Project", then "windows
    : application", empty project. I saved the source file asa a .cpp file.
    : Please tell me what I'm doing wrong. Thanks!
    :
    :

    Right click your project, go to project properties.
    Go to [b]Configuration Properties->General[/b] in the left tree pane.
    Set [b]Character Set[/b] to [b]Not Set[/b].

    The basic problem is that you are set to using unicode (Almost, if not all Win32 API unicode routine versions end in a "w" for wide-character sets.)

    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.brokenthorn.com]Website :: OS Development Series[rightbr][/link][/size]
Sign In or Register to comment.