Metodo IEnumCERTVIEWEXTENSION::GetName (certview.h)

Il metodo GetName recupera il nome dell'estensione corrente nella sequenza di enumerazione di estensione.

Il nome dell'estensione restituito è una stringa OID ( Object Identifier ), come in L"2.5.29.31".

Sintassi

HRESULT GetName(
  [out] BSTR *pstrOut
);

Parametri

[out] pstrOut

Puntatore a un valore di tipo BSTR che contiene il nome dell'estensione.

Valore restituito

C++

Se il metodo ha esito positivo, il metodo restituisce S_OK e tat il parametro pstrOut viene impostato sul nome dell'estensione.

Per usare questo metodo, creare una variabile di tipo BSTR , impostare la variabile su NULL e passare l'indirizzo di questa variabile come pstrOut. Al termine dell'uso di BSTR, liberarlo chiamando la funzione SysFreeString .

Se il metodo ha esito negativo, restituisce un valore HRESULT che indica l'errore. Per un elenco dei codici di errore comuni, vedere Valori HRESULT comuni.

VB

Il valore restituito è un valore String che contiene il nome dell'estensione.

Commenti

Questa funzione viene usata per recuperare il nome dell'estensione a cui fa attualmente riferimento la sequenza di enumerazione di estensione.

Se la sequenza di enumerazione di estensione non fa riferimento a un'estensione valida, GetName avrà esito negativo. Usare uno dei metodi seguenti per spostarsi nell'enumerazione :

Esempio

BSTR  bstrExtName = NULL;

// pEnumExt is previously instantiated IEnumCERTVIEWEXTENSION object
hr = pEnumExt->GetName(&bstrExtName);
if (S_OK == hr)
    printf("Extension name is: %ws\n", bstrExtName);
else
    printf("GetName failed: %x\n", hr);

// free memory when done
if (NULL != bstrExtName)
    SysFreeString(bstrExtName);

Requisiti

Requisito Valore
Client minimo supportato Nessuno supportato
Server minimo supportato Windows Server 2003 [solo app desktop]
Piattaforma di destinazione Windows
Intestazione certview.h (include Certsrv.h)
Libreria Certidl.lib
DLL Certadm.dll

Vedi anche

IEnumCERTVIEWEXTENSION

IEnumCERTVIEWEXTENSION::GetFlags

IEnumCERTVIEWEXTENSION::GetValue

IEnumCERTVIEWEXTENSION::Next

IEnumCERTVIEWEXTENSION::Reset

IEnumCERTVIEWEXTENSION::Skip