JoshT
Oct 2nd, 2001, 02:35 PM
MSDN says to use the EM_GETLINE message to get the text of an edit, you have to "set the first word of this buffer to the size, in TCHARs, of the buffer". It seems to work without doing so, but am I doing this right?
int length = 0;
char * pchText = NULL;
WORD mp = (WORD)MAX_PATH; \\???
pchText = (CHAR*)HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
CopyMemory(pchText, &mp, sizeof(WORD)); \\???
length = SendMessage(g_hSource, EM_GETLINE, 0, (LPARAM)pchText);
pchText[length+1] = '\0';
MessageBox(0, pchText, "test", MB_OK);
HeapFree(GetProcessHeap(), 0, pchText);
Thanks.
int length = 0;
char * pchText = NULL;
WORD mp = (WORD)MAX_PATH; \\???
pchText = (CHAR*)HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
CopyMemory(pchText, &mp, sizeof(WORD)); \\???
length = SendMessage(g_hSource, EM_GETLINE, 0, (LPARAM)pchText);
pchText[length+1] = '\0';
MessageBox(0, pchText, "test", MB_OK);
HeapFree(GetProcessHeap(), 0, pchText);
Thanks.