本文整理汇总了C++中CList::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ CList::Add方法的具体用法?C++ CList::Add怎么用?C++ CList::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CList
的用法示例。
在下文中一共展示了CList::Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dllInit
double dllInit()
{
CSocket::SockStart();
buffers.Add(new CBuffer());
sockets.Add(new CSocket()); //dummy socket
return 1;
}
示例2: AddBuffer
int AddBuffer(CBuffer*b)
{
for(int i = 0; i < buffers.count; i ++)
{
if(buffers[i] == NULL)
{
buffers.set(i, b);
return i;
}
}
buffers.Add(b);
return buffers.count-1;
}
示例3: AddSocket
int AddSocket(CSocket*b)
{
for(int i = 0; i < sockets.count; i ++)
{
if(sockets[i] == NULL)
{
sockets.set(i, b);
return i;
}
}
sockets.Add(b);
return sockets.count-1;
}
示例4: 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();
}
}