Bagikan melalui


IDiaSymbol::get_numericProperties

Mengambil set properti numerik untuk simbol ini.

Sintaks

HRESULT get_numericProperties(
    DWORD cnt,
    DWORD *pcnt,
    DWORD *pProperties
);

Parameter

cnt

[di] Jumlah DWORD yang diarahkan oleh buffer pProperties.

pcnt

[out] Mengembalikan jumlah properti valid yang ditetapkan dalam pProperties.

pProperties

[out] Mengembalikan kumpulan properti untuk simbol ini.

Tampilkan Nilai

Jika berhasil, mengembalikan S_OK; jika tidak, mengembalikan S_FALSE atau kode kesalahan.

Catatan

Nilai pengembalian S_FALSE berarti bahwa properti tidak tersedia untuk simbol.

Contoh

CComPtr<pSymbol> pSymbol;
BOOL f = FALSE;
HRESULT hr = E_FAIL;
...

hr = pSymbol->get_isHLSLData(&f);
if (FAILED(hr)) {
    return hr;
}
if (f) {
    DWORD value = 0;
    hr = pSymbol->get_numberOfRegisterIndices(&value);
    if (hr == S_OK && value > 0) {
        DWORD *pOff = new (std::nothrow) DWORD[value];
        if (pOff == NULL) {
            return E_OUTOFMEMORY;
        }
        DWORD propertiesRead;
        if (IfOkOrReportAuto(pSymbol->get_numericProperties(value, &propertiesRead, pOff))) {
            value = __min(value, propertiesRead);
            for (DWORD i = 0; i < value; i++) {
                printf("%u\n", pOff[i]);
            }
        }
        delete[] pOff;
    }
}

Lihat juga