void CDlgDisconnServer::OnOK() { BOOL bFullDisconnect = TRUE; CString csFullNodeName = BuildFullNodeName(m_pServerDataMin); // Replication monitoring special management // if (IsNodeUsed4ExtReplMon((LPUCHAR)(LPCTSTR)csFullNodeName,FALSE)) { // int ires = MessageBox("The current node is referenced by Windows monitoring replication on other nodes." // "In addition to closing the opened windows on the current node," // "Do you want to perform a full disconnect breaking the references?", // "Disconnect", // MB_ICONQUESTION | MB_YESNOCANCEL); // switch (ires) { // case IDCANCEL: // CDialog::OnCancel(); // return; // case IDYES: // bFullDisconnect = TRUE; // break; // case IDNO: // bFullDisconnect = FALSE; // break; // } // } int cpt; int count = m_windowslist.GetCount(); ForgetDelayedUpdates(); for (cpt = 0; cpt < count; cpt++) { HWND hWnd = (HWND)m_windowslist.GetItemData(cpt); CWnd *pWnd; pWnd = CWnd::FromHandlePermanent(hWnd); ASSERT (pWnd); CMDIChildWnd *pMdiChild = (CMDIChildWnd *)pWnd; pMdiChild->MDIDestroy(); } AcceptDelayedUpdates(); if (bFullDisconnect) { CWaitCursor hourglass; int hNode = GetVirtNodeHandle((LPUCHAR)(LPCTSTR)csFullNodeName); // CloseCachesExtReplicInfo((LPUCHAR)(LPCTSTR)csFullNodeName,FALSE);// not with /gw for instance FreeNodeStructsForName((LPUCHAR)(LPCTSTR)csFullNodeName,FALSE,TRUE); DBACloseNodeSessions ((LPUCHAR)(LPCTSTR)csFullNodeName,FALSE,TRUE); // FreeNodeStruct (hNode,FALSE); } CDialog::OnOK(); }
//------------------------------------------------------------------CancelRegInput void CScriptDoc::CancelRegInput(BOOL Fl) { if (m_pReguls.GetSize()) m_pReguls.RemoveAll(); m_sWord.RemoveAll(); m_sWordCount=0; if (theApp.CurrentTask&NEW_REGUL) theApp.CurrentTask&=~NEW_REGUL; else theApp.CurrentTask&=~EDIT_KB; ChangeSelectionToRowNo(1,m_ActKRow); UpdateAllViews(NULL,NULL,NULL); if (Fl==FALSE) { CMainFrame* pFrameWnd = (CMainFrame*)theApp.m_pMainWnd; CMDIChildWnd* pMDIActive = pFrameWnd->MDIGetActive(); if (pMDIActive == NULL) return; pMDIActive->MDIDestroy(); pFrameWnd-> CreateOrActivateFrame(theApp.pScriptDocTemplate, RUNTIME_CLASS(CModView)); } }