# EssOtlGetNextSharedMember

Description

EssOtlGetNextSharedMember() returns the member handle to the next shared member of the specified member.

Syntax

    ESS_FUNC_M EssOtlGetNextSharedMember (hOutline, hMember, phMember);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember
ESS_PHMEMBER_T | phMember

Parameters

hOutline | Outline context handle.
hMember | Handle of member to find the next shared member for.
phMember | Pointer for return of a member handle of the next shared member in the outline. This parameter is ESS_NULL if there are no more shared members.

Return Value

Returns 0 if successful.

Notes

- If hmember is the actual member, the first shared member is returned in the phMember parameter. If hmember is a shared member, the next shared member is returned in the phMember parameter.
- If there are no (more) shared members, phMember is set to ESS_NULL and the call returns 0.

Example

    #include <essapi.h>
    #include <essotl.h>

    ESS_STS_T          sts = 0;
    ESS_OBJDEF_T       Object;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hMember;
    ESS_HMEMBER_T      hMemberShared;
    ESS_HMEMBER_T      hNextShared;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;

    memset(&Object, '\0', sizeof(Object));
    Object.hCtx = hCtx;
    Object.ObjType = ESS_OBJTYPE_OUTLINE;
    strcpy(szAppName, "Sample");
    strcpy(szDbName, "Basic");
    strcpy(szFileName, "Basic");
    Object.AppName = szAppName;
    Object.DbName = szDbName;
    Object.FileName = szFileName;

    sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE,
          ESS_TRUE, &hOutline);

    if (!sts)
    {
       sts = EssOtlFindMember(hOutline, "200-20",
             &hMember);
    }

    if (!sts  && hMember)
    {
    /* get first shared member of actual member */
       sts = EssOtlGetNextSharedMember(hOutline, hMember, &hMemberShared);

    /* do something with hMemberShared */
    /* get next shared member, if any*/

       while(!sts && hMemberShared)
       {
         sts = EssOtlGetNextSharedMember(hOutline,
               hMemberShared, &hNextShared);
                 hMemberShared = hNextShared;

    /* do something with hMemberShared */
       }
    }

See Also

EssOtlFindMember()