MessageBox Error

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
Anyone know how to fix this?
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
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.
@integralfx

in C++/CLI it is called MessageBox::Show
Okay thanks. I used
 
MessageBox::Show("message", "title");

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