Share via


IDebugEngine2::ContinueFromSynchronousEvent

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Called by the session debug manager (SDM) to indicate that a synchronous debug event, previously sent by the debug engine (DE) to the SDM, was received and processed.

Syntax

HRESULT ContinueFromSynchronousEvent(
    IDebugEvent2* pEvent
);
HRESULT ContinueFromSynchronousEvent(
    IDebugEvent2 pEvent
);

Parameters

pEvent
[in] An IDebugEvent2 object that represents the previously sent synchronous event from which the debugger should now continue.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

The DE must verify that it was the source of the event represented by the pEvent parameter.

Example

The following example shows how to implement this method for a simple CEngine object that implements the IDebugEngine2 interface.

HRESULT CEngine::ContinueFromSynchronousEvent(IDebugEvent2* pEvent)
{
    HRESULT hr;

    // Create a pointer to a unique event interface defined for batch file
    // breaks.
    IAmABatchFileEvent *pBatEvent;
    // Check for successful query for the unique batch file event
    // interface.
    if (SUCCEEDED(pEvent->QueryInterface(IID_IAmABatchFileEvent,
                                        (void **)&pBatEvent)))
    {
        // Release the result of the QI.
        pBatEvent->Release();
        // Check thread message for notification to continue.
        if (PostThreadMessage(GetCurrentThreadId(),
                              WM_CONTINUE_SYNC_EVENT,
                              0,
                              0))
        {
            hr = S_OK;
        }
        else
        {
            hr = HRESULT_FROM_WIN32(GetLastError());
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }
    return hr;
}

See also