DWORD __stdcall MEditStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) 

    CString *psBuffer = (CString *)dwCookie;     if (cb > psBuffer->GetLength()) cb = psBuffer->GetLength();     for (int i=0;i<cb;i++) { 
    *(pbBuff+i) = psBuffer->GetAt(i); 
    }     *pcb = cb;     *psBuffer = psBuffer->Mid(cb);     return 0; 
} { 
CString strAAA, strBBB; //输出文字"..."RTF格式(AAA)
EDITSTREAM es; 
es.dwCookie = (DWORD)&strAAA; // Pass a pointer to the CString to the callback function 
es.pfnCallback = MEditStreamInCallback; // Specify the pointer to the callback function 
// Function defined in RichEg.cpp 
m_richedit.StreamIn(SF_RTF, es); //输出文字"..."RTF格式(BBB)
EDITSTREAM es; 
es.dwCookie = (DWORD)&strBBB; // Pass a pointer to the CString to the callback function 
es.pfnCallback = MEditStreamInCallback; // Specify the pointer to the callback function 
// Function defined in RichEg.cpp m_richedit.StreamIn(SF_RTF, es); 

//////////////////////////////////////
以上做法能分别将两段文字输出到richedit上,这两段文字是从数据库中读出的(两个字段)
如何将两段文字合起来,一起输出到richedit上???
我这样试,(不行)
....//从数据库中读strAAA, strBBB
strAAA += strBBB;EDITSTREAM es; 
es.dwCookie = (DWORD)&strAAA; // Pass a pointer to the CString to the callback function 
es.pfnCallback = MEditStreamInCallback; // Specify the pointer to the callback function 
// Function defined in RichEg.cpp 
m_richedit.StreamIn(SF_RTF, es);//在richedit上显示的还是AAA的内容

解决方案 »

  1.   

    我希望输出的内容是第一部分:     //重新加的
    ...//strAAA的内容
    第二部分:    //重新加的
    ...//strBBB的内容
      

  2.   

    CString strAAA, strBBB,strCCC;
    strCCC = strAAA + strBBB;
    这样应该可以的
      

  3.   

    你先设个断点看看这里strCCC的值对吗
      

  4.   

    strCCC = strAAA + strBBB;
    和strAAA += strBBB;不是一样吗?
      

  5.   

    CSDN竟然不能删除自己的贴子,给它提意见也置之不理,还得我自己重新注册一个ID来结这个贴子,真是SHIT!!!!!!!
    我的做法是:先StreamIn BBB,然后cut,StreamIn AAA, 后Paste
      

  6.   

    CSDN竟然不能删除自己的贴子,给它提意见也置之不理,还得我自己重新注册一个ID来结这个贴子,真是SHIT!!!!!!!
    我的做法是:先StreamIn BBB,然后cut,StreamIn AAA, 后Paste