Copy strings from editcontrols
Why doesent this work? :confused: All I get in my messagebox is... no nothing.
// Get the length of the line
//Make ready the buffer
char *buffer=new char [length+1];
//Add the terminating zero
//Copy the string
//Dont forget to delete trash
anonytmouse = wicked awesome
I've been banging my head against a wall for two days..
anonytmouse.. you are a genius.
void EditBoxFileParser(HWND hwnd, HWND hEdit)
//Get Number of Lines in Edit Field
iCount = SendMessage(hEdit, EM_GETLINECOUNT, 0, 0);
Lines = new TCHAR*[iCount];
//Populate 2D array - Lines[RowIndex][LineText]
for(int i=0; i<iCount; i++)
iLength = (WORD)SendMessage(hEdit, EM_LINELENGTH, i, 0);
Lines[i] = new TCHAR[iLength+sizeof(WORD)+1];
CopyMemory(Lines[i], &iLength, sizeof(WORD));
SendMessage(hEdit, EM_GETLINE, i, (LPARAM)Lines[i]);
Lines[i][iLength] = '\0';
MessageBox(NULL, Lines, "test", MB_OK);
my only question is.. why does it have to be this hard..?? why wouldn't it work they way Drogin had it set up...??? (which seems to be the intuitively easy way to do it)