Freigeben über


IDebugBreakpointRequest2::GetLocationType

Ruft den Haltepunktpositionstyp dieser Haltepunktanforderung ab.

Syntax

int GetLocationType(
    out enum_BP_LOCATION_TYPE pBPLocationType
);

Parameter

pBPLocationType
[out] Gibt einen Wert aus der BP_LOCATION_TYPE -Aufzählung zurück, die die Position dieser Haltepunktanforderung beschreibt.

Rückgabewert

Wenn dies erfolgreich ist, wird S_OKzurückgegeben; andernfalls wird ein Fehlercode zurückgegeben. Gibt E_FAIL zurück, wenn das feld bpLocation in der zugeordneten BP_REQUEST_INFO Struktur ungültig ist.

Beispiel

Das folgende Beispiel zeigt, wie Sie diese Methode für ein einfaches CDebugBreakpointRequest-Objekt implementieren, das die IDebugBreakpointRequest2 Schnittstelle verfügbar macht.

HRESULT CDebugBreakpointRequest::GetLocationType(BP_LOCATION_TYPE* pBPLocationType)
{
    HRESULT hr;

    if (pBPLocationType)
    {
        // Set default BP_LOCATION_TYPE.
        *pBPLocationType = BPLT_NONE;

        // Check if the BPREQI_BPLOCATION flag is set in BPREQI_FIELDS.
        if (IsFlagSet(m_bpRequestInfo.dwFields, BPREQI_BPLOCATION))
        {
            // Get the new BP_LOCATION_TYPE.
            *pBPLocationType = m_bpRequestInfo.bpLocation.bpLocationType;
            hr = S_OK;
        }
        else
        {
            hr = E_FAIL;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

Siehe auch