代码如下
void ShowMsg(char *pmsg)
{
    int   nLen = 0;
    char szBuf[1024] = {0};    if ((pmsg == NULL) || (strlen(pmsg) > 1024) || (strlen(pmsg) <= 0))
    {
        flag = 2;
        strcpy(szBuf, "Show Msg error\r\n");
    }    strcpy(szBuf,pmsg);
    nLen   =   GetWindowTextLength(hWndEdit);
    SendMessage(hWndEdit,   EM_SETSEL,   nLen,   -1);   
    SendMessage(hWndEdit,   EM_REPLACESEL,   (WPARAM)1,   (LPARAM)szBuf);   
}1.刚开始正常输出,但当程序中nLen=30000(watch中查看的)时,无法输出了,为什么呢?2. 另外对SendMessage(hWndEdit,   EM_REPLACESEL,   (WPARAM)1,   (LPARAM)szBuf)中szbuf是否可用pmsg代替,pmsg是否需要自己释放指针(pmsg是new出来的)。 谢谢