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 die Ausführung erfolgreich ist, wird S_OK, andernfalls ein Fehlercode zurückgegeben. Gibt zurück E_FAIL , wenn das bpLocation Feld 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 dieIDebugBreakpointRequest2-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