void CConfigMsgLogDlg::OnBnClickedCbtnAddlog(void)
{
    USES_CONVERSION;

    // Get unique log file name with full path.
    CString omFilePathNewLog = GetUniqueLogFilePath();

    // Add the new logging object in the datastore.
    SLOGINFO sLogStruct;
    //Select All CAN channels
    sLogStruct.m_ChannelSelected = CAN_CHANNEL_ALL;
    strcpy_s(sLogStruct.m_sLogFileName, _MAX_PATH, omFilePathNewLog.GetBuffer(_MAX_PATH));
    AddLoggingBlock(sLogStruct);

    // Added in data store updated. Now do the same in the GUI
    // Insert this item into the list and select the same. Naturally item index
    // will be 1 less than the total number of logging blocks.
    m_nLogIndexSel = GetLoggingBlockCount() - 1;
    AddNewItem_GUI(sLogStruct, m_nLogIndexSel);

    // Select this item
    m_omListLogFiles.SetItemState(m_nLogIndexSel, LVIS_SELECTED | LVIS_FOCUSED,
                                  LVIS_SELECTED | LVIS_FOCUSED);

    //EnablingAdvSettings(FALSE);
}
// To add a logging block; must be in editing mode
HRESULT CFrameProcessor_J1939::FPJ1_AddLoggingBlock(const SLOGINFO& sLogObject)
{
    return AddLoggingBlock(sLogObject);
}
// To add a logging block; must be in editing mode
HRESULT CFrameProcessor_CAN::FPC_AddLoggingBlock(const SLOGINFO& sLogObject)
{
    return AddLoggingBlock(sLogObject);
}