Are you sure you posted the actual code that's giving you the error? Because that code works fine for me (after fixing the tchar thing, but that's likely not your problem) and does what you'd expect.
To clarify... this code works just fine:
1 2 3 4 5 6 7 8
if (MessageBoxA(NULL,"The Message", "The Title", MB_YESNO) == IDYES)
{
MessageBoxA(NULL,"YES pressed","",MB_OK);
}
else
{
MessageBoxA(NULL,"NO pressed","",MB_OK);
}
You do realize the first MessageBox there (why are you trying to create two identical ones?) is missing an argument and that is likely what your compiler is complaining about.
MessageBoxA is the function you want (Read: not MessageBox -- you are not using TCHARs, so you don't want the TCHAR function)
When you call MessageBoxA, it will display the message box. Also, the return value of that function will be the result of the option the user selected.