共用方式為


IDebugBoundBreakpoint2::GetPendingBreakpoint

取得建立指定之系結斷點的暫止斷點。

語法

int GetPendingBreakpoint( 
    out IDebugPendingBreakpoint2 ppPendingBreakpoint
);

參數

ppPendingBreakpoint
[out]會傳 回 IDebugPendingBreakpoint2 物件,代表用來建立這個系結斷點的暫止斷點。

傳回值

如果成功,則會傳回 S_OK;否則,會傳回錯誤碼。

備註

暫止斷點可視為將斷點系結至可套用至一或多個程式之程序代碼所需的所有必要資訊的集合。

範例

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

HRESULT CBoundBreakpoint::GetPendingBreakpoint(
    IDebugPendingBreakpoint2** ppPendingBreakpoint)
{
    HRESULT hr;

    // Check for valid IDebugPendingBreakpoint2 interface pointer.
    if (ppPendingBreakpoint)
    {
        // Be sure that the bound breakpoint has not been deleted. If
        // deleted, then return hr = E_BP_DELETED.
        if (m_state != BPS_DELETED)
        {
            // Query for the IDebugPendingBreakpoint2 interface.
            hr = m_pPendingBP->QueryInterface(IID_IDebugPendingBreakpoint2,
                                              (void**)ppPendingBreakpoint);
        }
        else
        {
            hr = E_BP_DELETED;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

另請參閱