Share via


IDebugBreakpointRequest2::GetLocationType

Obtient le type d’emplacement du point d’arrêt de cette demande de point d’arrêt.

Syntaxe

int GetLocationType(
    out enum_BP_LOCATION_TYPE pBPLocationType
);

Paramètres

pBPLocationType
[out] Retourne une valeur de l’énumération BP_LOCATION_TYPE qui décrit l’emplacement de cette requête de point d’arrêt.

Valeur de retour

En cas de réussite, retourne S_OK , sinon, retourne un code d'erreur. Retourne E_FAIL si le bpLocation champ de la structure BP_REQUEST_INFO associée n’est pas valide.

Exemple

L’exemple suivant montre comment implémenter cette méthode pour un objet simple CDebugBreakpointRequest qui expose l’interfaceIDebugBreakpointRequest2 .

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

Voir aussi