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