MessageBox Error

Jan 31, 2016 at 10:51pm
I am getting these errors when I create a messagebox. The errors are below my messagebox code.

 
MessageBoxA(NULL, "it works", "works", 0);

http://s8.postimg.org/8zz9e9bqd/bandicam_2016_01_31_14_46_23_376.jpg
http://s8.postimg.org/p9pfh5med/bandicam_2016_01_31_14_46_38_805.jpg
http://s8.postimg.org/t8mmzzb1h/bandicam_2016_01_31_14_46_49_267.jpg
Last edited on Jan 31, 2016 at 10:58pm
Feb 1, 2016 at 2:36am
Anyone know how to fix this?
Feb 1, 2016 at 6:59am
It looks like you are using C++/CLI. Use the MessageBox Class instead of the Windows API.
https://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=vs.110).aspx
Feb 1, 2016 at 7:10am
closed account (E0p9LyTq)
My method for using MessageBox() is:

MessageBox(NULL, TEXT("Message Text"), TEXT("Caption"), MB_OK);

I let the compiler choose the version used, ANSI or Unicode, for both the MessageBox() function and the displayed text, depending on the character set used.

By the look of your error you are likely using the Unicode character set. MessageBoxA() is the ANSI version.
Feb 1, 2016 at 9:12am
@integralfx

in C++/CLI it is called MessageBox::Show
Feb 2, 2016 at 3:05am
Okay thanks. I used
 
MessageBox::Show("message", "title");

and it worked.
Topic archived. No new replies allowed.