CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    2

    [RESOLVED] Unable to StreamIN richedit. dwError = -16

    I am trying to copy RTF Text from one rich edit control to another (Rich Edit 4.1).

    The Code Works fine on x64.
    When the same code is compiled for x86, the rtf text is streamed out from one control successfully but the nothing is stream (SendMessage() returns Zero) when streaming in the RTF Text to another control.

    Following is the code:

    Code:
    DWORD EditStreamCallback(DWORD_PTR dwCookie,LPBYTE pbBuff,LONG cb,LONG* pcb)
    {
    	RTFDATA* prtfData = (RTFDATA *)dwCookie;
    	if(prtfData->Direction==__OUT)
    	{
    	*pcb = cb;
    	prtfData->pDataBytes=(LPBYTE)malloc(cb);
    	CopyMemory(prtfData->pDataBytes,pbBuff,cb);
    	prtfData->nDataBytes=cb;
    	}
    	if(prtfData->Direction==__IN)
    	{
    	if(prtfData->nDataBytes<cb)
    		{
    		*pcb = prtfData->nDataBytes;
    		memcpy(pbBuff,(void *)prtfData->pDataBytes,*pcb);
    		}
    	else
    		{
    		*pcb = cb;
    		memcpy(pbBuff,(void *)prtfData->pDataBytes,*pcb);
    		prtfData->pDataBytes+=cb;
    		}
    	}
    	return 0;
    }
    
    
    typedef struct structRTFData2{
    LPBYTE pDataBytes;
    size_t nDataBytes;
    WORD Direction;
    }RTFDATA,*LPRTFDATA;
    RTFDATA rtfData;
    Is there any documentation about dwerror of EDITSTREAM.
    (In My Case, dwError = -16)
    Please help me to figure out the problem.

    JAI SAYAN
    Last edited by Marc G; May 27th, 2009 at 05:38 AM. Reason: added code tags

Tags for this Thread

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

Featured