Delen via


IDebugBreakpointRequest2::GetLocationType

Hiermee haalt u het locatietype onderbrekingspunt van deze onderbrekingspuntaanvraag op.

Syntaxis

int GetLocationType(
    out enum_BP_LOCATION_TYPE pBPLocationType
);

Parameters

pBPLocationType
[uit] Retourneert een waarde uit de BP_LOCATION_TYPE opsomming die de locatie van deze onderbrekingspuntaanvraag beschrijft.

Retourwaarde

Als dit lukt, wordt S_OKgeretourneerd; retourneert anders een foutcode. Retourneert E_FAIL als het bpLocation veld in de gekoppelde BP_REQUEST_INFO structuur ongeldig is.

Voorbeeld

In het volgende voorbeeld ziet u hoe u deze methode implementeert voor een eenvoudig CDebugBreakpointRequest-object dat de IDebugBreakpointRequest2-interface beschikbaar maakt.

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

Zie ook