Bagikan melalui


IDebugBreakpointRequest2::GetLocationType

Mendapatkan jenis lokasi titik henti dari permintaan titik henti ini.

Sintaksis

int GetLocationType(
    out enum_BP_LOCATION_TYPE pBPLocationType
);

Parameter

pBPLocationType
[out] Mengembalikan nilai dari enumerasi BP_LOCATION_TYPE yang menjelaskan lokasi permintaan titik henti ini.

Mengembalikan Nilai

Jika berhasil, mengembalikan S_OK; jika tidak, mengembalikan kode kesalahan. Mengembalikan E_FAIL jika bidang bpLocation dalam struktur BP_REQUEST_INFO terkait tidak valid.

Contoh

Contoh berikut menunjukkan cara menerapkan metode ini untuk objek CDebugBreakpointRequest sederhana yang mengekspos antarmuka IDebugBreakpointRequest2.

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

Lihat juga