IDebugBreakpointUnboundEvent2::GetReason

取得斷點未系結的原因。

語法

int GetReason(
    out enum_ BP_UNBOUND_REASON pdwUnboundReason
);

參數

pdwUnboundReason
[out]從 BP_UNBOUND_REASON 列舉傳回值,指定斷點未系結的原因。

傳回值

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

備註

原因包括斷點在編輯后重新系結至不同的位置,或判斷斷點在錯誤中系結。

範例

下列範例示範如何針對公開 IDebugBreakpointUnboundEvent2 介面的 CBreakpointUnboundDebugEventBase 物件實作這個方法。

STDMETHODIMP CBreakpointUnboundDebugEventBase::GetReason(
    BP_UNBOUND_REASON* pdwUnboundReason)
{
    HRESULT hRes = E_FAIL;

    if ( EVAL(pdwUnboundReason) )
    {
        *pdwUnboundReason = m_dwReason;

        hRes = S_OK;
    }
    else
        hRes = E_INVALIDARG;

    return ( hRes );
}

另請參閱