I have no clue how to STRING BUFFER for lets say a LB_GETTEXT, SendMessage API Read Below:
Can someone tell me whats wrong with this:i get this error but im not sure how to use a nuffer i hjust Copyed it and Pasted itCode:case ID_GETLIST: { char *ListSel; PSTR ListStr; int x; x = SendMessage(list,LB_GETTEXTLEN,0,0); ListStr = (PSTR) VirtualAlloc((LPVOID) NULL, (DWORD) (x + 1), MEM_COMMIT, PAGE_READWRITE); SendMessage(list,LB_GETTEXT,0,ListStr); //GetWindowText(edit, ListStr,x + 1); ListSel = ListStr; SetWindowText(edit,ListSel); }
and then edited it. Is it correct?
ErrorCode:--------------------Configuration: Win32Controls - Win32 Debug-------------------- Compiling resources... Compiling... WinMain.cpp E:\Files\w32sk\WinMain.cpp(159) : error C2664: 'SendMessageA' : cannot convert parameter 4 from 'char *' to 'long' This conversion requires a reinterpret_cast, a C-style cast or function-style cast Error executing cl.exe. Win32Controls.exe - 1 error(s), 0 warning(s)




Reply With Quote