I am currently writing a Win32 application and when I compile I get a "Jump to case label" error and another error tellling me that switch(LOWORD(w Param)) is unreachable in the switch, when I remove the first case IDB_BUTTON it runs fine, but with it there are several compile errors.
Code:
LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_COMMAND: switch(LOWORD(wParam)) { case IDB_BUTTON: int leng = GetWindowTextLength(GetDlgItem(hWnd, IDB_EDITDATA)) + 1; char temp[leng]; GetDlgItemText(hWnd, IDB_EDITDATA, temp, leng); toencrypt.assign(temp); delete [] temp; leng = GetWindowTextLength(GetDlgItem(hWnd, IDB_EDIT)) + 1; char temp2[leng]; GetDlgItemText(hWnd, IDB_EDIT, temp2, leng); key.assign(temp2); delete [] temp2; encrypt(); break; case BTE_DECRYPT: int lengh = GetWindowTextLength(GetDlgItem(hWnd, IDB_EDITDATA)) + 1; char tempor[lengh]; GetDlgItemText(hWnd, IDB_EDITDATA, tempor, lengh); todecrypt.assign(tempor); delete [] tempor; lengh = GetWindowTextLength(GetDlgItem(hWnd, IDB_EDIT)) + 1; char tempore[lengh]; GetDlgItemText(hWnd, IDB_EDIT, tempore, lengh); key.assign(tempore); delete [] tempore; decrypt(); break; default: break; } break; case WM_DESTROY: // user wants to exit PostQuitMessage(WM_QUIT); break; default: // Hand off unprocessed messages to DefWindowProc return DefWindowProc(hWnd, Msg, wParam, lParam); } return 0; }
Comment