GetFirstProfile2

Top  Previous  Next

The GetFirstProfile2 starts an enumeration of profiles, retrieving the name of the first profile in the enumeration.

HRESULT GetFirstProfile2(

[out] BSTR* p_pwsProfileName,

[out] BOOL* p_bPublicProfile

);

 

Parameters:

p_pwsProfileName

[out] pointer to a pointer to a BSTR containing the name of the first existing profile. The caller must release the allocated memory using SysFreeString.

p_bPublicProfile

[in] Flag if the profile is a public or a private profile.

 

Return values:

S_OK on success or COM error code

NV_NOT_INITIALIZED - Initialize was not called

 

Remarks:

GetFirstProfile2 is used with GetNextProfile2 to retrieve profile names.

Sample usage:

hr = GetFirstProfile2(&pName);

while (SUCCEEDED(hr) && hr != NV_NO_MORE_PROFILES) {

// do something with pName

// ...

SysFreeString(pName);

// get next profile if it exists

hr = GetNextProfile2(&pName);

}