次の方法で共有


IDebugBoundBreakpoint2::GetBreakpointResolution

このブレークポイントを記述するブレークポイントの解決を取得します。

構文

int GetBreakpointResolution( 
    out IDebugBreakpointResolution2 ppBPResolution
);

パラメーター

ppBPResolution
[out] 次のいずれかを表す IDebugBreakpointResolution2 インターフェイスを返します。

  • コード ブレークポイントがバインドされているコード内の場所を記述するブレークポイント解決オブジェクト。

  • データ ブレークポイントがバインドされているデータの場所。

戻り値

成功した場合は、S_OK を返します。それ以外の場合は、エラー コードを返します。 バインドされたブレークポイント オブジェクトの状態が BPS_DELETED (BP_STATE 列挙の一部) に設定されている場合は、E_BP_DELETED を返します。

解説

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;
}

関連項目