Metodo IHomeGroup::IsMember (shobjidl_core.h)
Determina se il computer locale è membro di un gruppo Home.
Sintassi
HRESULT IsMember(
[out] BOOL *member
);
Parametri
[out] member
Tipo: BOOL*
Quando questo metodo viene restituito correttamente, riceve TRUE se il computer locale è membro di un Gruppo Home; in caso contrario, FALSE.
Valore restituito
Tipo: HRESULT
Se questo metodo ha esito positivo, restituisce S_OK. In caso contrario, restituisce un codice di errore HRESULT .
Commenti
Il frammento di codice seguente illustra come creare un'istanza di IHomeGroup e chiamare IHomeGroup::IsMember.
#include "shobjidl.h"
#include "atlbase.h" // For COM smart pointers
CComPtr<IHomeGroup> spHomeGroup;
HRESULT hr = S_OK;
BOOL fIsHGMember = FALSE;
// Initialize the COM subsystem.
hr = CoInitialize(NULL);
if (FAILED(hr)) return hr;
// Create an instance of IHomeGroup.
hr = CoCreateInstance(CLSID_HomeGroup,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&spHomeGroup));
if (FAILED(hr)) return hr;
// fIsHGMember receives the value TRUE if the local computer is a member of a
// HomeGroup, or FALSE if the computer is not a HomeGroup member.
hr = spHomeGroup->IsMember(&fIsHGMember);
Requisiti
Requisito | Valore |
---|---|
Client minimo supportato | Windows 7 [solo app desktop] |
Server minimo supportato | Windows Server 2008 R2 [solo app desktop] |
Piattaforma di destinazione | Windows |
Intestazione | shobjidl_core.h (include Shobjidl.h) |