HRESULT CRunBreakPoint::OnDemandBreakpoint(CebScript *pScript, CebThread *pThread, IObjectManagement *pIOM, IStreamInfo *pISI) { ASSERT(NULL != pScript); ASSERT(NULL != pThread); if (pScript == NULL || pThread == NULL) return E_POINTER; ASSERT(NULL != pThread->GetHandle()); ASSERT(NULL != pScript->GetHandle()); if (NULL == pScript->GetHandle() || NULL == pThread->GetHandle()) return E_HANDLE; HRESULT hr = NOERROR; try {// evtl. Debuggerfenster erzeugen hr = CreateDebugger(WM_CLOSEBREAKPOINTDEBUGGERDIALOG, false, 0, pIOM, pISI); if (FAILED(hr)) _com_issue_error(hr); // Fertzigen Script und Thread unterschieben if (!ebDebugger_SetScript(GetDebuggerWnd(), pScript->GetHandle())) _com_issue_error(E_FAIL); if (!ebDebugger_SetThread(GetDebuggerWnd(), pThread->GetHandle())) _com_issue_error(E_FAIL); // jetzt Debugger anzeigen hr = m_pScriptDebugger -> RunModal(); if (FAILED(hr)) _com_issue_error(hr); } catch(_com_error& e) { if (m_pScriptDebugger) m_pScriptDebugger -> DestroyWindow(); m_pScriptDebugger = NULL; return _COM_ERROR(e); } return S_OK; }
HRESULT CRunErr::OnDemandBreakpoint(CebScript *pScript, CebThread *pThread) { ASSERT(NULL != pScript); ASSERT(NULL != pThread); if (pScript == NULL || pThread == NULL) return E_POINTER; ASSERT(NULL != pThread->GetHandle()); ASSERT(NULL != pScript->GetHandle()); if (NULL == pScript->GetHandle() || NULL == pThread->GetHandle()) return E_HANDLE; // testen, ob im richtigen Kontext verwendet ASSERT(!m_fRTError); m_fRunModal = true; // evtl. Debuggerfenster erzeugen if (NULL == m_pScriptDebugger) { HRESULT hr = CreateDebugger(); if (FAILED(hr)) return hr; ASSERT(NULL != m_pScriptDebugger); } if (!ebDebugger_SetScript(GetDebuggerWnd(), pScript->GetHandle())) return E_FAIL; if (!ebDebugger_SetThread(GetDebuggerWnd(), pThread->GetHandle())) return E_FAIL; // jetzt Debugger anzeigen HRESULT hr = m_pScriptDebugger -> RunModal(); if (E_ABORT == hr || E_UNEXPECTED == hr) // Debugger wurde geschlossen m_fRunModal = false; return hr; }