In all the time i have been programming and coding, i have never seen a problem as weird as this:
I have a login form on my program, and username and password field and a login button:
Heres my validate function:
Here's my createwindows in the WM_CREATE section:Code:BOOL CppWnd::validateInput(){ LPSTR Test; LPSTR Passy; int nLen = SendMessage(m_hUsernameEdit, WM_GETTEXTLENGTH,0,0); int nLenPass = SendMessage(m_hPasswordEdittwo, WM_GETTEXTLENGTH,0,0); GetDlgItemText(hAppWnd, IDE_USERNAME, Test, 55); GetDlgItemText(hAppWnd, IDE_PASS, Passy, 54); // else MessageBox(hAppWnd, (LPSTR)Passy, "Invalid Data Entered", MB_OK | MB_ICONEXCLAMATION); MessageBox(hAppWnd, (LPSTR)Test, "Invalid Data Entered", MB_OK | MB_ICONEXCLAMATION); if(((lstrlen(Test)) < 1) || ((lstrlen(Passy)) < 1)){ MessageBox(hAppWnd, Passy, "Invalid Data Entered", MB_OK | MB_ICONEXCLAMATION); return FALSE; } }
I made sure there were no name conflicts or anything.Code:m_hUsernameEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_VISIBLE | WS_CHILD, 60,20, 100, 20, hAppWnd, (HMENU)IDE_USERNAME, hInst, NULL); m_hPasswordEdittwo = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_VISIBLE | WS_CHILD, 230, 20, 100, 20, hAppWnd, (HMENU)IDE_PASS, hInst, NULL);
The program compiles fine so i put some message boxes to test a bug,
When i put something for username, username shows up FINE!!!! WORKS GREAT!!!, but when i do the same for Password field, (i removed ES_PASSWORD), it gives wierd string with weird alphabets, and says it doesnt have a string length.
Now how can TWO identical EDIT fields, with IDENTICAL processes (I looked all over my program with find, and couldnt find any conflicts of name or anything) have a result where one works and the other doesnt?![]()
![]()



LinkBack URL
About LinkBacks



