CTabCtrl DeleteItem does not work in every case

64 Views Asked by At

i have a function which loops through map (the map contains the index of my CTabCtrl-Tab and the ID of the Document which is shown in the Tab) and if the ID of the current selected Tab is not similar to the ID of the current looped tab, the tab should be removed.

int deleteTab = -1;

for (auto i : tabIndexToFBNR)
{
    deleteTab = i.first;

    if (i.second == m_pDlgSubFBs.at(m_AktTab)->m_pRecFB->m_ID)
        deleteTab = -1;

    if (deleteTab != -1)
        m_tabSubFB.DeleteItem(deleteTab);
}

Problem is: Some tabs are removed, some are not. The return code of DeleteItem is always "1".

Any ideas?

0

There are 0 best solutions below