Thanks a lot Daved!
Actually im trying to rewrite this function to c++ and im wondering what to use.
Dont know if i need vector of vector or just vector?
Code:
int iCount;
WORD iLength, iOffset;
TCHAR **Lines;
//Get Number of Lines in Edit Field
iCount = SendMessage(hEdit, EM_GETLINECOUNT, 0, 0);
//If Editbox is empty, exit function
if(!iCount)
return;
Lines = new TCHAR*[iCount];
//Populate 2D array, Lines[LineIndex][LineText]
for(int i=0; i<iCount; i++)
{ iOffset = SendMessage(hEdit, EM_LINEINDEX, i, 0);
iLength = (WORD)SendMessage(hEdit, EM_LINELENGTH, iOffset, 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';
}