2 Replies - 476 Views - Last Post: 17 November 2009 - 10:04 PM Rate Topic: -----

#1 deborah_morales1990  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 08-April 09

first gui program win32

Posted 17 November 2009 - 09:56 PM

hello, I am new to win32 GUI

I am in this tutorial and it says to paste this

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
	LPSTR lpCmdLine, int nCmdShow)
{
	MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
	return 0;
}



but i keep getting this error:

error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR'

I don't understand

Thank you

This post has been edited by deborah_morales1990: 17 November 2009 - 09:57 PM


Is This A Good Question/Topic? 0
  • +

Replies To: first gui program win32

#2 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: first gui program win32

Posted 17 November 2009 - 09:57 PM

Go into project settings. Under general configuration, change character set to Multibyte
Was This Post Helpful? 0
  • +
  • -

#3 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3122
  • View blog
  • Posts: 19,167
  • Joined: 14-September 07

Re: first gui program win32

Posted 17 November 2009 - 10:04 PM

or throw a L in front of the text:

MessageBox(NULL, L"Goodbye, cruel world!", L"Note", MB_OK);


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1