Results 1 to 3 of 3

Thread: Filling the first word of the buffer

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032

    Filling the first word of the buffer

    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?

    Code:
    	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.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yeah, this is right. I don't know about intel byte order, butI think windows can handle this.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Ok, thanks.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width