华为云会议 MEETING-场景7:加入会议:示例代码

时间:2024-10-28 14:49:59

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// 通过会议ID加入会议
int demoJoinConfByIdDlg::clickJoinConfById()
{
    // 填写会议ID和会议密码;未登录场景下加入会议时,也可以配置本会场的会场名称
    hwmsdkagent::HwmJoinConfByIdInfo data;
    memset(&data, 0, sizeof(hwmsdkagent::HwmJoinConfByIdInfo));
 
    strncpy_s(data.confId, GetMeetingID().c_str(), HWM_MAX_CONF_ID_LEN);
    strncpy_s(data.password, GetAccessCode().c_str(), HWM_MAX_PASSWORD_LEN);
    strncpy_s(data.name, GetParticipantName().c_str(), HWM_MAX_DISPLAY_NAME_LEN);
    
    int ret = hwmsdkagent::JoinConfById(&data);
    return ret;
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/**
* 会议id入会接口回调
*/
void demoCallbackProc::OnJoinConfByIdResult(hwmsdk::HwmErrCode ret, const char* msg)
{
     CS tring codeStr;
    codeStr.Format(_T("%d"), ret);
    string msgStr = CTools::UTF82MultiByte(msg);
    CString tips = _T("OnJoinConfByIdResult code:") + codeStr + _T(", msg:") + CString(msgStr.c_str());
    AfxMessageBox(tips);
}

OnConfState和OnConfInfo的事件通知跟创建会议场景相同,请参考创建会议的示例代码

support.huaweicloud.com/sdkreference-meeting/win_demo_0011.html