APIEnv_​ProjectSharingID

Returns the project sharing data in the case of a TeamWork project.

    GSErrCode ACAPI_Environment (
        APIEnv_ProjectSharingID,
        API_SharingInfo*     sharingInfo
    );

 

Parameters

sharingInfo
data of the registered members of the team project

 

Return Values

NoError
The function completed with success.
APIERR_BADPARS
sharingInfo is nullptr.
APIERR_NOPLAN
sharingInfo is nullptr.
APIERR_MEMFULL
Low memory condition.

For other common API errors see the API Errors document.

 

Remarks

This function is used to get the registered members of the opened team project. Member data are returned through an array of API_UserInfo records.

Do not forget to dispose the member data handle if it is not needed any more.

 

Example


API_SharingInfo    sharingInfo;
Int32               i;
char               buffer[256];
GSErrCode          err;

BNZeroMemory (&sharingInfo, sizeof (API_SharingInfo));
err = ACAPI_Environment (APIEnv_ProjectSharingID, &sharingInfo, nullptr, nullptr);
if (err) {
    GiveMessage_Err ("Error in APIEnv_ProjectSharingID", err);
    return;
}

for (i = 0; i < sharingInfo.nUsers; i++) {
    sprintf (buffer, "  \"%10s\"   id:%2d   %s",
             (*sharingInfo.users)[i].name,
             (*sharingInfo.users)[i].userId,
             (*sharingInfo.users)[i].connected ? "Connected" : "");
    if ((*sharingInfo.users)[i].userId == projectInfo.userId)
        buffer[0] = '*';
    GiveMessage (buffer, false);
}

BMKillHandle ((GSHandle *) &sharingInfo.users);

 

Requirements

Version: API 2.1 or later
Header: APIdefs_Environment.h

 

See Also

API_UserInfo, API_SharingInfo,
ACAPI_Environment, API Functions