VC++ MFC Static Text 赋值

有一个自定义的方法

 void OnEnter(long long nConfID, long long nTimeUTC, const char *szConfXml, int nResult)
{
    if(nResult)
    {
        MessageBox(NULL, "会议创建失败","提示:", MB_OK );
        return;
    }
    else
    {
        MessageBox(NULL, "会议创建成功","提示:", MB_OK );
        CString ConfXml;
        ConfID=nConfID;
        ConfXml=szConfXml;;
        int index=ConfXml.Find(_T("subject"));
        int index1=ConfXml.Find (_T("syncdesktop"));
        confName=ConfXml.Mid(index+9,(index1-2)-(index+9));
        HWND hwnd=::FindWindow(NULL,"Web_Demo1");
        CStatic* sm=(CStatic*)::GetDlgItem(hwnd,IDC_STATICMemo);
        sm->SetWindowText(confName);
    }
}

HWND hwnd=::FindWindow(NULL,"Web_Demo1");
这句话提示错误:CXX0030 无法计算表达是的值

IDC_STATICMemo 给他赋值时提示错误请高手帮帮忙

先看你的CStatic* sm=(CStatic*)::GetDlgItem(hwnd,IDC_STATICMemo);
sm是否为合法指针

HWND hwnd=::FindWindow(NULL,"Web_Demo1");
hwnd = GetDlgItem(hwnd, IDC_STATICMemo);
::SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)confName);

当添加Static Text控件后,需要给其赋值,赋值方式:点击控件右键,在Caption给Static Text赋值,在vs中为Text......
答案就在这里:MFC给Static Text赋值
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。