VideoCapture::~VideoCapture() { OAFilterState state = State_Running; int counter = 0; if (pControl!=NULL) { pControl->Pause(); pControl->Stop(); while(state==State_Running) { if (pControl->GetState(10000, &state)==VFW_S_STATE_INTERMEDIATE) break; counter++; } } if (pConfig!=NULL) { pConfig->Release(); pConfig = NULL; } if (pGrabber!=NULL) { pGrabber->Release(); pGrabber = NULL; } if (pControl!=NULL) { pControl->Release(); pControl = NULL; } DestroyTable(&devices_resolutions); DestroyTable(&devices_names); DestroyTable(&callback.cbInfo.pBuffer); CoUninitialize( ); }
int main() { HashTable H; H = initializeTable(353); int i; int key; Position P; ////insertKey(1,H); //insertKey(2,H); //insertKey(3,H); ////deleteKey(1,H); //deleteKey(2,H); //deleteKey(3,H); for(i=0; i<100; i++) { key = i; insertKey(key, H); } //deleteKey(100, H); //for(i=99; i>=0; i--) // deleteKey(i, H); P = FindKey(6,H); printf("Index %d is found\n",P); PrintHashTable(H); DestroyTable(H); std::cout<<std::endl; }
//测试函数 void Test() { HashTable T; InitTable(&T); //插入序列 int pIn[13] = { 0, 3, 6, 5, 7, 10, 23, 89, 100, 111, 81,91,93}; //int pIn[10] = { 0, 3, 6, 5, 7, 10, 23, 89, 100, 111}; //搜索序列 int pSe[11] = {11, 3, 6, 5, 7, 0 , 23, 89, 100, 111, 80 }; printf("插入序列:\n"); for (int i = 0; i < 13; i++) { printf("%d- ",i); InsertToTable(&T, pIn[i]); } printf("\n搜索序列:\n"); for (int i = 0; i < 11; i++) { int nCom = 0; printf("%d- ",i); printf("目标:%3d 哈希值:%2d 结果: %2d",pSe[i],GetHash(T,pSe[i]),SearchTable(T, pSe[i], &nCom)); printf(" 比较:%3d\n", nCom); } DestroyTable(&T); }
void PressureTable::Unload(void) { DestroyTable(); TableFilename.clear(); CombustionModel.clear(); ChemTableType.clear(); VarNames.clear(); VarNamesMap.clear(); }
void RichEdit::TableRemoveColumn() { if(IsSelection() || !cursorp.table) return; NextUndo(); if(cursorp.tabsize.cx <= 1) DestroyTable(); else { SaveTable(cursorp.table); text.RemoveTableColumn(cursorp.table, cursorp.cell.x); Move(text.GetCellPos(cursorp.table, text.GetMasterCell(cursorp.table, cursorp.cell)).pos); } }
int main() { p_list p; HashTable H = InitializeTable(50); readfile(H); check(100,H); check(1201,H); check(26966,H); //traverse(H); double_del(H); printf("\n"); traverse(H); DestroyTable(H); return 0; }
int main(void){ HashTable H = InitializeTable(20); printf("%d\n",H->TableSize); printf("%d\n",H->TheList[0]->data); int choice; int item; instructions(); printf("your choice:"); scanf("%d",&choice); while(choice != 4){ switch(choice){ case 1: printf("\nEnter a number:\n"); scanf("%d",&item); Insert(item,H); break; case 2: printf("\nEnter a number to delete\n"); scanf("%d",&item); Delete(item,H); break; case 3: printTable(H); break; default: printf("\nInvaild choice\n\n"); instructions(); break; } printf("\nyour choice:"); scanf("%d",&choice); } DestroyTable(H); printf("End of run\n"); return 0; }
Table3D::~Table3D() { DestroyTable(); }
void RichEdit::TableProps() { if(IsSelection() || cursorp.table == 0) return; RichEditTableProperties dlg; dlg.Breaker(dlg.destroy, IDNO); RichTable::Format fmt = text.GetTableFormat(cursorp.table); String ratios; for(int i = 0; i < fmt.column.GetCount(); i++) { if(i) ratios << ':'; ratios << "1"; } dlg.ratios.SetFilter(CharFilterEqualize); dlg.ratios <<= ratios; CtrlRetriever r; Advn(r, dlg.before.SetUnit(unit), fmt.before); Advn(r, dlg.after.SetUnit(unit), fmt.after); Advn(r, dlg.lm.SetUnit(unit), fmt.lm); Advn(r, dlg.rm.SetUnit(unit), fmt.rm); Advn(r, dlg.frame.SetUnit(unit), fmt.frame); r(dlg.framecolor, fmt.framecolor); Advn(r, dlg.grid.SetUnit(unit), fmt.grid); Advn(r, dlg.header, fmt.header); Advn(r, dlg.keep, fmt.keep); Advn(r, dlg.newpage, fmt.newpage); Advn(r, dlg.newhdrftr, fmt.newhdrftr); dlg.header_qtf = fmt.header_qtf; dlg.footer_qtf = fmt.footer_qtf; r(dlg.gridcolor, fmt.gridcolor); dlg.SyncHdrFtr(); dlg.newhdrftr.Enable(cursorp.level == 1); dlg.hdrftr.Enable(cursorp.level == 1); for(;;) { switch(dlg.Run()) { case IDCANCEL: return; case IDNO: NextUndo(); DestroyTable(); return; default: r.Retrieve(); if(dlg.newhdrftr) { fmt.header_qtf = dlg.header_qtf; fmt.footer_qtf = dlg.footer_qtf; } else fmt.header_qtf = fmt.footer_qtf = Null; const RichTable& tbl = text.GetConstTable(cursorp.table); bool valid = true; Point violator(0, 0); int vspan = 0; for(int rw = 0; valid && rw < fmt.header && rw < tbl.GetRows(); rw++) for(int co = 0; valid && co < tbl.GetColumns(); co++) if(tbl(rw, co) && (vspan = tbl[rw][co].vspan) + rw > fmt.header) { valid = false; violator.x = co; violator.y = rw; break; } if(!valid) { Exclamation(NFormat(t_("Invalid header row count %d, cell at rw %d, co %d has vspan = %d."), fmt.header, violator.y + 1, violator.x + 1, vspan)); continue; } NextUndo(); SaveTableFormat(cursorp.table); if(dlg.equalize) { Vector<String> r = Split((String)~dlg.ratios, ':'); for(int i = 0; i < fmt.column.GetCount(); i++) fmt.column[i] = i < r.GetCount() ? max(atoi(r[i]), 1) : 1; } text.SetTableFormat(cursorp.table, fmt); Finish(); return; } } }
void DestroyInstrTable(void){ free(opStrHashFindTbl); DestroyTable(instrHashTbl); }