当前位置: 首页>>代码示例>>C++>>正文


C++ CList::Erase方法代码示例

本文整理汇总了C++中CList::Erase方法的典型用法代码示例。如果您正苦于以下问题:C++ CList::Erase方法的具体用法?C++ CList::Erase怎么用?C++ CList::Erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CList的用法示例。


在下文中一共展示了CList::Erase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FillAddinsList

// -----------------------------------------------------------------------
// The the listview with found AddIns
void FillAddinsList(void)
{
    int i = 0;
    CStr AddInName;
    HMODULE AddInLib = 0;
    FARPROC AddInDesc = 0;
    FARPROC AddInAuth = 0;
    FARPROC AddInLoad = 0;
    FARPROC AddInUnload = 0;
    FARPROC AddInMenu = 0;
    CStr Description;
    CStr Auth;
    long PosInIniFile = 0;
    CStr LoadedInIniFile;
    long AddInIcon = 0;
    CStr RunningInIniFile;
    CStr BufString;

    AddInName = FileDir(&((CStr) Dirs[DIR_ADDINS] + (CStr) "\\*.dll"));
    LocalAddInsFiles.Erase();
    while(AddInName.Len() != 0)
    {
        BufString = Dirs[DIR_ADDINS] + (CStr) "\\" + (CStr) AddInName;
        AddInLib = LoadLibrary(BufString.Get_String());
        if(AddInLib != 0)
        {
            AddInDesc = GetProcAddress(AddInLib, "AddInDescription");
            AddInAuth = GetProcAddress(AddInLib, "AddInAuthor");
            AddInLoad = GetProcAddress(AddInLib, "AddInLoad");
            AddInUnload = GetProcAddress(AddInLib, "AddInUnLoad");
            AddInMenu = GetProcAddress(AddInLib, "AddInMenu");
            // Must have all procedures
            if(AddInDesc != 0 && AddInAuth != 0 && AddInLoad != 0 && AddInUnload != 0 && AddInMenu != 0)
            {
                Description = GetDLLDescription(AddInName, AddInDesc);
                Auth = GetDLLAuthor(AddInAuth);
                AddInIcon = ICON_ADDINR;
                PosInIniFile = CheckAddInIniList(AddInName);
                if(PosInIniFile != -1)
                {
                    // Check if it is running if found in ini file
                    RunningInIniFile = IniReadKey("AddIns", "Running" + (CStr) StringNumberComplement(PosInIniFile, 3).Get_String(), MainIniFile);
                    if(_strcmpi(RunningInIniFile.Get_String(), "1") == 0) AddInIcon = ICON_ADDINS;
                }
                ListViewAddItem(FRMAddInsListView, Description, i, AddInIcon);
                ListViewSetSubItem(FRMAddInsListView, Auth, i, 1);
                // Check in the ini file if it's been already loaded
                PosInIniFile = CheckAddInIniList(AddInName);
                if(PosInIniFile != -1)
                {
                    LoadedInIniFile = IniReadKey("AddIns", "Loaded" + (CStr) StringNumberComplement(PosInIniFile, 3).Get_String(), MainIniFile);
                    if(LoadedInIniFile.Len() != 0)
                    {
                        if(_strcmpi(LoadedInIniFile.Get_String(), "1") == 0)
                        {
                            ListViewSetItemCheckbox(FRMAddInsListView, i, 1);
                        }
                        else
                        {
                            ListViewSetItemCheckbox(FRMAddInsListView, i, 0);
                        }
                    }
                    else
                    {
                        ListViewSetItemCheckbox(FRMAddInsListView, i, 0);
                    }
                }
                LocalAddInsFiles.Add(AddInName.Get_String());
                i++;
            }
            FreeLibrary(AddInLib);
            // Dlg_Filters.cpp for more infos
            #ifndef _DEBUG
                CloseHandle(AddInLib);
            #endif
        }
        AddInName = FileDir();
    }
}
开发者ID:GaoHongchen,项目名称:chromatic,代码行数:81,代码来源:Dlg_AddIns.cpp


注:本文中的CList::Erase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。