How to convert this way properly?
    VARIANT varIndex;
    CString csIndex;
    //Index BSTR
    csIndex = (LPCSTR)(_bstr_t)vtIndex;
    csIndex.MakeUpper();
    if (csIndex.Left(3) == PROCESSUS_TABLE)
    {
        lIndex = atoi((LPCSTR)csIndex.Mid(3));
        if ((unsigned long)lIndex<0)
            return E_INVALIDARG;
    }
Error message:
C2664: 'int atoi(const char *)' : cannot convert argument 1 from 'ATL::CStringT<wchar_t,ATL::StrTraitATL<wchar_t,ATL::ChTraitsCRT<wchar_t>>>' to 'const char *'
I couldn't find how to fix this, any good idea, please?