本文整理汇总了C++中CList::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ CList::Get方法的具体用法?C++ CList::Get怎么用?C++ CList::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CList
的用法示例。
在下文中一共展示了CList::Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FRMAddInsProc
// -----------------------------------------------------------------------
// Initialize Form
int CALLBACK FRMAddInsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT CreatePs;
long CurrentLvItem = 0;
long AddInIcon = 0;
CStr RunningInIniFile;
POINT PopMenuCoords;
CStr OpFilters;
CStr LdFile;
FARPROC AddInAuthUpDate = 0;
FARPROC AddInDescUpDate = 0;
long OldRunningState = 0;
CStr BufString;
switch(uMsg)
{
case WM_SYSCOLORCHANGE:
ListViewSetBackColor(FRMAddInsListView, GetSysColor(COLOR_WINDOW));
break;
case WM_INITDIALOG:
FRMAddInshWnd = hwndDlg;
ControlSetText(hwndDlg, "AddIns manager");
FRMAddInsCmdOk = CreateButton(327, 292, 77, 23, hwndDlg, "Ok", 1, 0, 0, 0, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP, Buttons_StaticEdge);
FRMAddInsCmdCancel = CreateButton(406, 292, 77, 23, hwndDlg, "Cancel", 2, 0, 0, 0, WS_TABSTOP, Buttons_StaticEdge);
FRMAddInsListView = CreateListView(2, 1, 482, 278, hwndDlg, 0, GlobalImageList1, 0, LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP | LVS_EX_CHECKBOXES, LVS_REPORT | LVS_SINGLESEL | WS_TABSTOP | LVS_NOSORTHEADER, WS_EX_STATICEDGE);
ListViewAddCol(FRMAddInsListView, "Author", 198, 0);
ListViewAddCol(FRMAddInsListView, "Description", 265, 1);
ListViewSetItemSel(FRMAddInsListView, 0);
FillAddinsList();
hAddInsMenu = CreatePopupMenu();
MenuAddString(hAddInsMenu, "Load/Unload AddIn", ADDIN_IDBASE + ADDIN_ENABLE, TRUE);
MenuSetDefaultItem(hAddInsMenu, 0);
MenuAddSeparator(hAddInsMenu);
MenuAddString(hAddInsMenu, "Display in AddIns menu", ADDIN_IDBASE + ADDIN_MENU, TRUE);
MenuAddString(hAddInsMenu, "Remove from AddIns menu", ADDIN_IDBASE + ADDIN_REMMENU, TRUE);
MenuAddSeparator(hAddInsMenu);
MenuAddString(hAddInsMenu, "Update AddIn", ADDIN_IDBASE + ADDIN_UPDATE, TRUE);
FreezeTimer = 1;
return(0);
case WM_PAINT:
BeginPaint(hwndDlg, &CreatePs);
GDIDrawHorzSep(hwndDlg, 0, 285, 486);
EndPaint(hwndDlg, &CreatePs);
break;
case WM_COMMAND:
if((HWND) lParam == FRMAddInsCmdOk)
{
SaveAddInList();
ReFillAddInsArrays();
FillAddInsMenu();
RefreshRunningStates();
ControlClose(hwndDlg);
return(0);
}
else if((HWND) lParam == FRMAddInsCmdCancel)
{
ControlClose(hwndDlg);
return(0);
}
switch(wParam)
{
case (ADDIN_ENABLE + ADDIN_IDBASE):
AddInIcon = ListViewGetSubItemImage(FRMAddInsListView, CurrentPopupItem, 0);
if(AddInIcon == ICON_ADDINR) AddInIcon = ICON_ADDINS;
else AddInIcon = ICON_ADDINR;
ListViewSetSubItemImage(FRMAddInsListView, AddInIcon, CurrentPopupItem, 0);
return(0);
case (ADDIN_MENU + ADDIN_IDBASE):
ListViewSetItemCheckbox(FRMAddInsListView, CurrentPopupItem, 1);
return(0);
case (ADDIN_REMMENU + ADDIN_IDBASE):
ListViewSetItemCheckbox(FRMAddInsListView, CurrentPopupItem, 0);
return(0);
case (ADDIN_UPDATE + ADDIN_IDBASE):
OpFilters = AppTitle + (CStr) " AddIn (*.dll)|*.dll";
LdFile = ComDlgGetOpenFileName(hwndDlg, OpFilters, LastAddInDir, 0, CurrentDir);
if(LdFile.Len() != 0)
{
// Check if the AddIn is located in AddIns directory
if(_strcmpi(FileGetDirectory(LdFile).Get_String(), Dirs[DIR_ADDINS]) == 0)
{
MiscMsgBox(hwndDlg, "New AddIn can't be located in AddIns directory.", MB_ERROR, Requesters);
return(0);
}
// Check if file exist
if(FileExist(Dirs[DIR_ADDINS] + (CStr) "\\" + (CStr) FileGetFileName(LdFile)) == 0)
{
MiscMsgBox(hwndDlg, "No corresponding AddIn found.", MB_ERROR, Requesters);
return(0);
}
// Check if names are identicals
if(_strcmpi(LocalAddInsFiles.Get(CurrentPopupItem)->Content,
FileGetFileName(LdFile).Get_String()) != 0)
{
MiscMsgBox(hwndDlg, "AddIn name doesn't match.", MB_ERROR, Requesters);
return(0);
}
if(IsAddIn(LdFile) == 0)
//.........这里部分代码省略.........
示例2: SaveAddInList
// -----------------------------------------------------------------------
// Save the list of selected addins
void SaveAddInList(void)
{
int i = 0;
long NewAddInPos = 0;
long AddInIcon = 0;
// Delete every entries
IniDeleteKey("AddIns", "", MainIniFile);
// First refresh ini file with found addins
for(i = 0; i <= (long) ListViewItemCount(FRMAddInsListView) - 1; i++)
{
// Obtain an empty slot
NewAddInPos = GetAddInSlot();
IniWriteKey("AddIns", "File" + (CStr) StringNumberComplement(NewAddInPos, 3).Get_String(), LocalAddInsFiles.Get(i)->Content, MainIniFile);
IniWriteKey("AddIns", "Loaded" + (CStr) StringNumberComplement(NewAddInPos, 3).Get_String(), ListViewGetItemCheckbox(FRMAddInsListView, i), MainIniFile);
// User wants to run it now ?
AddInIcon = ListViewGetSubItemImage(FRMAddInsListView, i, 0);
if(AddInIcon == ICON_ADDINS) IniWriteKey("AddIns", "Running" + (CStr) StringNumberComplement(NewAddInPos, 3).Get_String(), "1", MainIniFile);
else IniWriteKey("AddIns", "Running" + (CStr) StringNumberComplement(NewAddInPos, 3).Get_String(), "0", MainIniFile);
}
// Save old datas
OldRunningAddIns.Erase();
OldRunningAddIns.MAdd(RunningAddIns.Amount(), 0L);
OldAddInsFiles.Erase();
OldAddInsFiles.MAdd(AddInsFiles.Amount(), "");
OldAddInsDLL.Erase();
OldAddInsDLL.MAdd(AddInsDLL.Amount(), 0L);
for(i = 0; i < RunningAddIns.Amount(); i++)
{
// Save names
OldAddInsFiles.Set(i, AddInsFiles.Get(i)->Content);
// Save handles
OldAddInsDLL.Set(i, AddInsDLL.Get(i)->Content);
// Save running states
OldRunningAddIns.Set(i, RunningAddIns.Get(i)->Content);
}
}