本文整理汇总了C++中CArray::RemoveAll方法的典型用法代码示例。如果您正苦于以下问题:C++ CArray::RemoveAll方法的具体用法?C++ CArray::RemoveAll怎么用?C++ CArray::RemoveAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArray
的用法示例。
在下文中一共展示了CArray::RemoveAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPartHashs
bool CAICHRecoveryHashSet::GetPartHashs(CArray<CAICHHash>& rResult) const
{
ASSERT( m_pOwner );
ASSERT( rResult.IsEmpty() );
rResult.RemoveAll();
if (m_pOwner->IsPartFile() || m_eStatus != AICH_HASHSETCOMPLETE){
ASSERT( false );
return false;
}
uint32 uPartCount = (uint16)(((uint64)m_pOwner->GetFileSize() + (PARTSIZE - 1)) / PARTSIZE);
if (uPartCount <= 1)
return true; // No AICH Part Hashs
for (uint32 nPart = 0; nPart < uPartCount; nPart++)
{
uint64 nPartStartPos = (uint64)nPart*PARTSIZE;
uint32 nPartSize = (uint32)min(PARTSIZE, (uint64)m_pOwner->GetFileSize()-nPartStartPos);
const CAICHHashTree* pPartHashTree = m_pHashTree.FindExistingHash(nPartStartPos, nPartSize);
if (pPartHashTree != NULL && pPartHashTree->m_bHashValid)
rResult.Add(pPartHashTree->m_Hash);
else
{
rResult.RemoveAll();
ASSERT( false );
return false;
}
}
return true;
}
示例2:
CServer::~CServer(void)
{
for (int i =0; i < g_LedInfos.GetCount(); i++)
{
delete g_LedInfos.GetAt(i);
}
g_LedInfos.RemoveAll();
for (int i =0; i < g_DeviceInfos.GetCount(); i++)
{
for (int j = 0; j < g_DeviceInfos.GetAt(i)->aGroupInfos.GetCount(); j++)
{
delete g_DeviceInfos.GetAt(i)->aGroupInfos.GetAt(j);
}
delete g_DeviceInfos.GetAt(i);
}
g_DeviceInfos.RemoveAll();
//for (int i =0; i < g_GroupInfos.GetCount(); i++)
//{
// delete g_GroupInfos.GetAt(i);
//}
//g_GroupInfos.RemoveAll();
//CloseSocket();
}
示例3: OnInitDialog
BOOL CDialogInvProcess::OnInitDialog()
{
CDialog::OnInitDialog();
CArray<int,int> arIds;
CStringArray arTickers;
// Raw Materials
CSQLInvProcess::Get(1, arIds, arTickers);
for(int i=0; i<arIds.GetSize(); i++)
{
int nInd = m_listRaw.AddString(arTickers[i]);
m_listRaw.SetItemData(nInd, arIds[i]);
}
// WIP
arIds.RemoveAll();
arTickers.RemoveAll();
CSQLInvProcess::Get(2, arIds, arTickers);
for(int i=0; i<arIds.GetSize(); i++)
{
int nInd = m_listWIP.AddString(arTickers[i]);
m_listWIP.SetItemData(nInd, arIds[i]);
}
// QC
arIds.RemoveAll();
arTickers.RemoveAll();
CSQLInvProcess::Get(3, arIds, arTickers);
for(int i=0; i<arIds.GetSize(); i++)
{
int nInd = m_listQC.AddString(arTickers[i]);
m_listQC.SetItemData(nInd, arIds[i]);
}
// Portfolio
arIds.RemoveAll();
arTickers.RemoveAll();
CSQLInvProcess::Get(4, arIds, arTickers);
for(int i=0; i<arIds.GetSize(); i++)
{
int nInd = m_listPort.AddString(arTickers[i]);
m_listPort.SetItemData(nInd, arIds[i]);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例4: SetActionText
void CInteractionAreaDialog::SetActionText(CMouseAction *pMouseAction, int nEditId)
{
CString csText;
csText.Empty();
UINT nPageOrMarkId = pMouseAction->GetPageMarkId();
AreaActionTypeId nActionTypeId = pMouseAction->GetActionId();
if (nActionTypeId == INTERACTION_JUMP_SPECIFIC_PAGE)
{
csText = m_pEditorDoc->project.GetPageTitleForId(nPageOrMarkId);
}
else if (nActionTypeId == INTERACTION_JUMP_TARGET_MARK)
{
CArray<CStopJumpMark *, CStopJumpMark *> caJumpMarks;
CMarkStream *pMarkStream = m_pEditorDoc->project.GetMarkStream();
pMarkStream->GetJumpMarksInRegion(caJumpMarks, 0, m_pEditorDoc->m_displayEndMs);
for (int i = 0; i < caJumpMarks.GetSize(); ++i)
{
if (caJumpMarks[i]->GetId() == nPageOrMarkId)
{
csText = caJumpMarks[i]->GetLabel();
break;
}
}
caJumpMarks.RemoveAll();
}
else if (nActionTypeId == INTERACTION_OPEN_URL || nActionTypeId == INTERACTION_OPEN_FILE)
{
csText = pMouseAction->GetPath();
}
CEdit *pEdit = (CEdit *)GetDlgItem(nEditId);
pEdit->SetWindowText(csText);
}
示例5: Reset
void CTobCompiler::Reset()
{
m_line = 0;
m_err.Empty();
m_bin.RemoveAll();
if(m_fsrc) { fclose(m_fsrc); m_fsrc = 0; }
if(m_fdst) { fclose(m_fdst); m_fdst = 0; }
POSITION p = m_defbin.GetStartPosition();
CString str;
CByteArray* bin;
while(p)
{
m_defbin.GetNextAssoc(p, str, bin);
delete bin;
}
m_defbin.RemoveAll();
m_defbin.InitHashTable(251);
m_label.RemoveAll();
m_label.InitHashTable(251);
for(int i = m_exp.GetSize() - 1; i >= 0; --i)
delete m_exp.GetAt(i);
m_exp.RemoveAll();
m_change.RemoveAll();
m_change.InitHashTable(251);
m_bit_i = 32;
m_bit_f = 32;
m_maxc = -1;
m_maxw = -1;
m_maxs = -1;
}
示例6: GetDriveItems
// Gets all items of type IT_DRIVE.
//
void CDirstatDoc::GetDriveItems(CArray<CItem *, CItem *>& drives)
{
drives.RemoveAll();
CItem *root = GetRootItem();
if(NULL == root)
{
return;
}
if(IT_MYCOMPUTER == root->GetType())
{
for(int i = 0; i < root->GetChildrenCount(); i++)
{
CItem *drive = root->GetChild(i);
ASSERT(IT_DRIVE == drive->GetType());
drives.Add(drive);
}
}
else if(IT_DRIVE == root->GetType())
{
drives.Add(root);
}
}
示例7: CreateSlidePopup
void CInteractionAreaDialog::CreateSlidePopup(int nAction, int nButtonId, int nEditId)
{
CRect rcButton;
CWnd *pWndButton = GetDlgItem(nButtonId);
pWndButton->GetClientRect(rcButton);
pWndButton->ClientToScreen(&rcButton);
m_wndMenu.CreatePopupMenu();
CArray<CPage *, CPage *> caPages;
m_pEditorDoc->project.GetPages(caPages, 0, m_pEditorDoc->m_docLengthMs);
for (int i = 0; i < caPages.GetSize(); ++i)
{
CString csPageTitle;
csPageTitle = caPages[i]->GetTitle();
m_wndMenu.AppendMenu(MF_STRING, i+1, csPageTitle);
}
BOOL bRet = m_wndMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, rcButton.left, rcButton.bottom, this);
CWnd *pEdit = GetDlgItem(nEditId);
// if bRet is zero the menu was cancelled
// or an error occured
if (bRet != 0)
{
CString csItem;
m_wndMenu.GetMenuString(bRet, csItem, MF_BYCOMMAND);
pEdit->SetWindowText(csItem);
m_nMarkOrPageId[nAction] = caPages[bRet-1]->GetJumpId();
}
caPages.RemoveAll();
m_wndMenu.DestroyMenu();
}
示例8: OnInitDialog
BOOL CSubtitleDlDlg::OnInitDialog()
{
__super::OnInitDialog();
m_status.Create(WS_CHILD | WS_VISIBLE | CCS_BOTTOM, CRect(0, 0, 0, 0), this, IDC_STATUSBAR);
int n, curPos = 0;
CArray<int> columnWidth;
CString strColumnWidth = AfxGetApp()->GetProfileString(IDS_R_DLG_SUBTITLEDL, IDS_RS_DLG_SUBTITLEDL_COLWIDTH, _T(""));
CString token = strColumnWidth.Tokenize(_T(","), curPos);
while (!token.IsEmpty()) {
if (_stscanf_s(token, L"%i", &n) == 1) {
columnWidth.Add(n);
token = strColumnWidth.Tokenize(_T(","), curPos);
} else {
throw 1;
}
}
m_list.SetExtendedStyle(m_list.GetExtendedStyle()
| LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT
| LVS_EX_CHECKBOXES | LVS_EX_LABELTIP);
if (columnWidth.GetCount() != 5) {
// default sizes
columnWidth.RemoveAll();
columnWidth.Add(290);
columnWidth.Add(70);
columnWidth.Add(50);
columnWidth.Add(50);
columnWidth.Add(270);
}
m_list.InsertColumn(COL_FILENAME, ResStr(IDS_SUBDL_DLG_FILENAME_COL), LVCFMT_LEFT, columnWidth[0]);
m_list.InsertColumn(COL_LANGUAGE, ResStr(IDS_SUBDL_DLG_LANGUAGE_COL), LVCFMT_CENTER, columnWidth[1]);
m_list.InsertColumn(COL_FORMAT, ResStr(IDS_SUBDL_DLG_FORMAT_COL), LVCFMT_CENTER, columnWidth[2]);
m_list.InsertColumn(COL_DISC, ResStr(IDS_SUBDL_DLG_DISC_COL), LVCFMT_CENTER, columnWidth[3]);
m_list.InsertColumn(COL_TITLES, ResStr(IDS_SUBDL_DLG_TITLES_COL), LVCFMT_LEFT, columnWidth[4]);
AddAnchor(IDC_LIST1, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_CHECK1, BOTTOM_LEFT);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDC_STATUSBAR, BOTTOM_LEFT, BOTTOM_RIGHT);
const CSize s(420, 200);
SetMinTrackSize(s);
EnableSaveRestore(IDS_R_DLG_SUBTITLEDL);
// start new worker thread to download the list of subtitles
m_pTA = DEBUG_NEW THREADSTRUCT;
m_pTA->url = m_url;
m_pTA->hWND = GetSafeHwnd();
SetStatus(ResStr(IDS_SUBDL_DLG_DOWNLOADING));
AfxBeginThread(RunThread, static_cast<LPVOID>(m_pTA));
return TRUE;
}
示例9: ResetListItems
// 清空属性列表
void CDlgReadInfo::ResetListItems()
{
m_wndList.DeleteAllItems();
paramList.RemoveAll();
GetDlgItem(IDC_SAVE)->EnableWindow(FALSE);
}
示例10: OnInitDialog
BOOL CDialogCompanies::OnInitDialog()
{
CDialog::OnInitDialog();
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
strcpy(lf.lfFaceName, "Arial");
lf.lfHeight = 14;
m_Font.CreateFontIndirect(&lf);
//m_editTicker.EnableWindow(false);
// Get Companies
for(int i=0; i<theApp.m_Universe.GetSize(); i++)
{
CCompany* pCompany = theApp.m_Universe.GetCompany(i);
CString sItem;
sItem.Format("%s - %s", pCompany->GetTicker(), pCompany->GetName());
int nIndex = m_List.AddString(sItem);
m_List.SetItemData(nIndex, (DWORD)pCompany);
}
CArray<int,int> arIds;
CStringArray arNames;
int nCount;
// Get Industries (really Sectors from DB)
nCount = CSQLCompany::GetSectorIdsAndNames(arIds, arNames);
for(int i=0; i<nCount; i++)
{
int nIndex = m_comboIndustry.AddString(arNames[i]);
m_comboIndustry.SetItemData(nIndex, arIds[i]);
}
// Get Sectors (really Industries from DB)
arIds.RemoveAll(); arNames.RemoveAll();
nCount = CSQLCompany::GetIndustryIdsAndNames(arIds, arNames);
for(int i=0; i<nCount; i++)
{
int nIndex = m_comboSector.AddString(arNames[i]);
m_comboSector.SetItemData(nIndex, arIds[i]);
}
m_arEditWeights[0] = GetDlgItem(IDC_EDIT_W1);
m_arEditWeights[1] = GetDlgItem(IDC_EDIT_W2);
m_arEditWeights[2] = GetDlgItem(IDC_EDIT_W3);
m_arEditWeights[3] = GetDlgItem(IDC_EDIT_W4);
m_arEditWeights[4] = GetDlgItem(IDC_EDIT_W5);
m_arEditWeights[5] = GetDlgItem(IDC_EDIT_W6);
m_arEditWeights[6] = GetDlgItem(IDC_EDIT_W7);
m_arEditWeights[7] = GetDlgItem(IDC_EDIT_W8);
m_arEditWeights[8] = GetDlgItem(IDC_EDIT_W9);
m_List.SetCurSel(0);
SetValues(0);
return TRUE;
}
示例11: FindDupes
int WINAPI FindDupes(const char* szList, HWND hParent)
{
AFX_MANAGE_STATE(AfxGetAppModuleState());
hStopEvent=CreateEvent(0,0,0,0);
sListOfImages.RemoveAll();
sListOfImagesToDelete.RemoveAll();
sListOfImageDibs.RemoveAll();
CString sFiles=szList;
sFiles.Replace("\r","");
sFiles+="\n";
while(sFiles.GetLength()>0){
CString sWPTitle=sFiles.SpanExcluding("\n");
if(strlen(sWPTitle)!=strlen(sFiles)){
sFiles=sFiles.Mid(strlen(sWPTitle)+1);
}else{
sFiles="";
}
if(sWPTitle!="" && FindMini(sFiles,sWPTitle+"\n")==-1){
sListOfImages.Add(sWPTitle);
}
}
if(hCheckThread){
TerminateThread(hCheckThread,0);
hCheckThread=0;
}
DWORD dwID=0;
hCheckThread=CreateThread(0,0,CheckImages,0,0,&dwID);
DialogBox(theApp.m_hInstance,MAKEINTRESOURCE(IDD_DIALOG),hParent,OptionsDialogProc);
bStopCheck=1;
csCheck.Lock();
csCheck.Unlock();
WaitForSingleObject(hStopEvent,1000);
CloseHandle(hStopEvent);
if(hCheckThread){
TerminateThread(hCheckThread,0);
}
CloseHandle(hCheckThread);
hCheckThread=0;
hStopEvent=0;
for(int i=0;i<sListOfImageDibs.GetSize();i++){
if(sListOfImageDibs[i]){
delete sListOfImageDibs[i];
}
}
sPathInLeft="";
sPathInRight="";
if(btLeft){
_bmpX()->ReleaseBmp(btLeft);
btLeft=0;
}
if(btRight){
_bmpX()->ReleaseBmp(btRight);
btRight=0;
}
return lDeletedFiles;
}
示例12: GetSelectionList
void DcapWellboreZoneDesigGridCell::GetSelectionList(CStringArray& aText, CArray<bool,bool>& aEnable)
{
aText.RemoveAll();
aEnable.RemoveAll();
for (int i = 0; i < DataCaptureGridCtrl::wellboreZoneStrings.Size(); i++)
{
aText.Add(DataCaptureGridCtrl::wellboreZoneStrings[i]);
aEnable.Add(true);
}
}
示例13: LoadDxfFile
void CGraph::LoadDxfFile(CString dxfFileString)
{
g_ptrGraphArray.RemoveAll();
DxfReading(dxfFileString);
GraphInit();
PreviewDxfGraph();
}
示例14: GetSelectionList
void SequenceDesigGridCell::GetSelectionList(CStringArray& aText, CArray<bool,bool>& aEnable)
{
aText.RemoveAll();
aEnable.RemoveAll();
for (int i = 0; i < TestZoneCurveGridCtrl::sequenceDesigStrings.Size(); i++)
{
aText.Add(TestZoneCurveGridCtrl::sequenceDesigStrings[i]);
aEnable.Add(true);
}
}
示例15: GetExportFunctionInfo
u32 CHookFunction_i::GetExportFunctionInfo(CArray<EXPORT_FUN_INFO, EXPORT_FUN_INFO&>& InfoArray,
const char* pszDllFile)
{
if(!pszDllFile)
{
return 0;
}
PLOADED_IMAGE pImage = ::ImageLoad((char*)pszDllFile, NULL);
if(!pImage)
{
return 0;
}
DWORD dwBase = (DWORD)pImage->MappedAddress;
PIMAGE_SECTION_HEADER pSections = (PIMAGE_SECTION_HEADER)((DWORD)pImage->FileHeader + sizeof(IMAGE_NT_HEADERS));
PIMAGE_EXPORT_DIRECTORY pExportDir = (PIMAGE_EXPORT_DIRECTORY)(RVA2RawAdr(pSections, pImage->FileHeader->OptionalHeader.DataDirectory[0].VirtualAddress) + dwBase);
InfoArray.RemoveAll();
EXPORT_FUN_INFO info;
DWORD* pFunOffsetAdr = (DWORD*)(RVA2RawAdr(pSections, pExportDir->AddressOfFunctions) + dwBase);
for(DWORD i = 0; i < pExportDir->NumberOfFunctions; i++)
{
info.dwOffset = 0;
info.strFunName = "";
info.dwOrdinal = 0;
info.dwOffset = *(pFunOffsetAdr + i);
info.dwOrdinal = i + 1;
InfoArray.Add(info);
}
DWORD* pFunNamesAdr = (DWORD*)(RVA2RawAdr(pSections, pExportDir->AddressOfNames) + dwBase);
WORD* pFunNamesOrdinalAdr = (WORD*)(RVA2RawAdr(pSections, pExportDir->AddressOfNameOrdinals) + dwBase);
char* pName = NULL;
for(i = 0; i < pExportDir->NumberOfNames; i++)
{
pName = (char*)(RVA2RawAdr(pSections, *(pFunNamesAdr+i)) + dwBase);
int idx = *(pFunNamesOrdinalAdr+i);
if(idx < InfoArray.GetSize())
{
EXPORT_FUN_INFO& tmpInfo = InfoArray.ElementAt(idx);
tmpInfo.strFunName = pName;
}
}
ImageUnload(pImage);
return InfoArray.GetSize();
}