Share via


IDebugBoundBreakpoint2::GetBreakpointResolution

取得描述這個斷點的斷點解析。

語法

int GetBreakpointResolution( 
    out IDebugBreakpointResolution2 ppBPResolution
);

參數

ppBPResolution
[out]會傳 回代表下列其中一項的 IDebugBreakpointResolution2 介面:

  • 斷點解析物件,描述程式代碼斷點已系結之程序代碼中的位置。

  • 數據斷點已系結的數據位置。

傳回值

如果成功,則會傳回 S_OK;否則,會傳回錯誤碼。 E_BP_DELETED如果繫結斷點物件的狀態設定為 BPS_DELETED (BP_STATE 列舉的一部分),則傳回 。

備註

呼叫 GetBreakpointType 方法,以判斷斷點解析是否適用於程式代碼或數據。

範例

下列範例示範如何為公開IDebugBoundBreakpoint2 介面的簡單CBoundBreakpoint物件實作這個方法。

HRESULT CBoundBreakpoint::GetBreakpointResolution(
    IDebugBreakpointResolution2** ppBPResolution)
{
    HRESULT hr;

    if (ppBPResolution)
    {
        // Verify that the bound breakpoint has not been deleted. If
        // deleted, then return hr = E_BP_DELETED.
        if (m_state != BPS_DELETED)
        {
            // Query for the IDebugBreakpointResolution2 interface.
            hr = m_pBPRes->QueryInterface(IID_IDebugBreakpointResolution2,
                                          (void **)ppBPResolution);
            assert(hr == S_OK);
        }
        else
        {
            hr = E_BP_DELETED;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

另請參閱