# cnfGetCoaching

Retrieves a list of conference members who can or cannot hear member memberid.

#### Prototype

DWORD cnfGetCoaching ( CNFRESOURCEHD cnfresourcehd, DWORD memberid, BYTE flag, unsigned maxlistenerids, DWORD *listeneridlist, unsigned numlistenerids)

Argument | Description
cnfresourcehd | Resource handle returned by cnfOpenResource.
memberid | Member identifier returned by cnfJoinConference.
flag | Value of either CNF_COACHING_HEAR or CNF_COACHING_SILENT.
maxlistenerids | Maximum number of entries in listeneridlist array.
listeneridlist | Depending on the flag, points to a list of members who can hear memberid (CNF_COACHING_HEAR) or to a list of members who cannot hear memberid (CNF_COACHING_SILENT).
numlistenerids | Number of listeners in the conference. Returned by the function.

#### Return values

Return value | Description
SUCCESS |
CTAERR_BOARD_ERROR |
CTAERR_INVALID_HANDLE | cnfresourcehd is not a valid conference handle.
CNFERR_CAPABILITY_NOT_AVAILABLE | Conference does not have coaching capabilities.
CNFERR_INVALID_IDENTIFIER | memberid is not a valid member identifier.

#### Details

cnfGetCoaching retrieves the list of members who can or cannot (depending on the value of flag) hear the member for which the function was called. This feature is typically used to enable a coach to listen to a conference and provide input to one or more colleagues without the knowledge of other conference members.

#### See also

cnfSetCoaching

#### Example

// Force the relationship for a member to SILENT
void SetSilent(CNFRESOURCEHD cnfresourcehd, DWORD basemember, DWORD member)
{
DWORD error;
unsigned numlistenerids;
DWORD*memberidlist = NULL;
// Retrieve the current list size
error = cnfGetCoaching(cnfresourcehd, basemember, CNF_COACHING_SILENT, 0, NULL, &numlistenerids);
if (error != SUCCESS)
{
printf("Error %d when retrieving coaching on member %d", error , basemember);
}
// allocate buffer
memberidlist = malloc((numlistenerids + 1) * sizeof(unsigned));
if (memberidlist == NULL);
{
printf("Unable to allocate memory buffer");
}
// Retrieve the current list
error = cnfGetCoaching(cnfresourcehd, basemember, CNF_COACHING_SILENT, numlistenerids,
memberidlist, &numlistenerids);
memberidlist[numlistenerids] = member;
numlistenerids += 1;
error = cnfSetCoaching(cnfresourcehd, basemember, CNF_COACHING_SILENT, memberidlist,
numlistenerids);
if (error != SUCCESS)
{
printf("Error %d when setting coaching on member %d", error , basemember);
}
free(memberidlist);
}