Aracılığıyla paylaş


IDebugBreakpointRequest2::GetLocationType

Bu kesme noktası isteğinin kesme noktası konum türünü alır.

Sözdizimi

  • C#
  • C++
int GetLocationType(
    out enum_BP_LOCATION_TYPE pBPLocationType
);

Parametre

pBPLocationType
[out] BP_LOCATION_TYPE numaralandırmasından bu kesme noktası isteğinin konumunu açıklayan bir değer döndürür.

Dönüş Değeri

Başarılı olursa, S_OKdöndürür; aksi takdirde bir hata kodu döndürür. İlişkili BP_REQUEST_INFO yapısındaki bpLocation alanı geçerli değilse E_FAIL döndürür.

Örnek

Aşağıdaki örnek, IDebugBreakpointRequest2 arabirimini kullanıma sunan basit bir CDebugBreakpointRequest nesnesi için bu yöntemin nasıl uygulandığını gösterir.

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

Ayrıca bkz.