HRESULT CSignalWatch_LIN::SW_DoInitialization(void* RefObj, void* ouCluster)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());

    cluster= (ClusterConfig*)ouCluster;
    SW_UpdateMsgInterpretObj(RefObj);

    //Create the signal watch window for CAN
    if (m_pouSigWnd == nullptr)
    {
        m_pouSigWnd = new CSigWatchDlg(AfxGetMainWnd(), LIN);
        m_pouSigWnd->Create(IDD_DLG_SIGNAL_WATCH, nullptr);
        m_pouSigWnd->SetWindowText("Signal Watch - LIN");
    }

    CBaseDIL_LIN* pouDIL_LIN;
    if (DIL_GetInterface(LIN, (void**)&pouDIL_LIN) == S_OK)
    {
        DWORD dwClientId = 0;
        pouDIL_LIN->DILL_RegisterClient(TRUE, dwClientId, LIN_MONITOR_NODE);
        pouDIL_LIN->DILL_ManageMsgBuf(MSGBUF_ADD, dwClientId, &(m_ouLinBufFSE));
    }
    //Start the read thread
    return bStartSigWatchReadThread()? S_OK: S_FALSE;
}
HRESULT CSignalWatch_CAN::SW_DoInitialization()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    //Create the signal watch window for CAN
    if (m_pouSigWnd == NULL)
    {
        m_pouSigWnd = new CSigWatchDlg;
        m_pouSigWnd->Create(IDD_DLG_SIGNAL_WATCH, NULL);
        m_pouSigWnd->SetWindowText("Signal Watch - CAN");
    }

    CBaseDIL_CAN* pouDIL_CAN;
    if (DIL_GetInterface(CAN, (void**)&pouDIL_CAN) == S_OK)
    {
        DWORD dwClientId = 0;
        pouDIL_CAN->DILC_RegisterClient(TRUE, dwClientId, CAN_MONITOR_NODE);
        pouDIL_CAN->DILC_ManageMsgBuf(MSGBUF_ADD, dwClientId, &(m_ouCanBufFSE));
    }
    //Start the read thread
    return bStartSigWatchReadThread()? S_OK: S_FALSE;
}