Heres the deal, its a windows program btu it more involves a C++ problem.
Basically, the user has a dialog box open and they can input numbers and text, however, i want to make it so they HAVE to input something before clicking "ok" in order for it to process. Now, im a big OOP programmer in the past so i thought this method would work, any other method i try gets general errors.
Code:
case IDOK:
GetDlgItemText(hwnd, G_COLOR, szGlowColor, 7);
GetDlgItemText(hwnd, G_STRENGTH, szGlowStrength, 3);
GetDlgItemText(hwnd, G_TEXT, szGlowString, 700);
if(!szGlowColor) {
MessageBox(hwnd, "You must enter in a value for the color", "Error", MB_OK);
return FALSE;
} else {
if(!szGlowStrength) {
MessageBox(hwnd, "You must enter in a value for the strength", "Error", MB_OK);
return FALSE;
} else {
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) "<table style='Filter: Glow(Color=#");
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) szGlowColor);
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) ", Strength=");
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) szGlowStrength);
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) ")'><tr><td>");
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) szGlowString);
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) 0, (LPARAM) "</td></table>");
EndDialog(hwnd, 0);
return TRUE;
}
}
return FALSE;
break;
i need to check if szGlowColor and szGlowStrength have a value entered in them, doesn't matter if its numerical or alphabetical, just need to check is somethings in there.
(EDIT: took out the formatting for horizontal scrolling sakes)