IHomeGroup::IsMember method (shobjidl_core.h)
Determines whether the local computer is a member of a HomeGroup.
Syntax
HRESULT IsMember(
[out] BOOL *member
);
Parameters
[out] member
Type: BOOL*
When this method returns successfully, receives TRUE if the local computer is a member of a HomeGroup; otherwise, FALSE.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The following code snippet shows how to create an instance of IHomeGroup and call 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);
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | shobjidl_core.h (include Shobjidl.h) |
See also
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για