When I run this code or try to i get the error" buf, and buf2 undeclared identifiers". I declared them though. And then once I try and do the calculation on multiplying s and b I get 0 in the messagebox. I cannot figure out what is going on. Any help is greatly appreciated!!Code:int result; int len = GetWindowTextLength(editwage); if(len>0) TCHAR *buf = new TCHAR[len + 1]; GetWindowText(editwage,buf,len+1); MessageBox(NULL,buf,"hi",MB_OK); int s = atoi(buf); int len2 = GetWindowTextLength(edithrs); if(len2>0) TCHAR *buf2 = new TCHAR[len2 + 1]; GetWindowText(edithrs,buf,len2+1); int b = atoi(buf2); result = s * b; char buffer[10]; char* sztext = itoa(result,buffer,10); MessageBox(NULL,sztext,"testing",MB_OK); return 0; }





Reply With Quote