The GetNextProfile continues an enumeration of profiles started with GetFirstProfile, retrieving the id of the next profile in the enumeration.
HRESULT GetNextProfile(
[out] LPWSTR* p_pwsProfileId
);
Parameters:
p_pwsProfileId
[out] pointer to a pointer to a null terminated Unicode string containing the name of the next existing profile. The caller must release the allocated memory using CoTaskMemFree.
Return values:
S_OK
on success or COM error codeNV_NOT_INITIALIZED
- Initialize was not calledNV_ENUM_NOT_INIT
- enumerate was not started, GetFirstProfile was not called beforeNV_NO_MORE_PROFILES
- there are no more profiles to enumerateRemarks:
GetNextProfile is used with GetFirstProfile to retrieve profile names.
Sample usage:
hr = GetFirstProfile(&pName);
while (SUCCEEDED(hr) && hr != NV_NO_MORE_PROFILES) {
// do something with pName
//...
CoTaskMemFree(pName);
// get next profile if it exists
hr = GetNextProfile(&pName);
}