Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CE U14 C++] issue with mdlNamedGroup_getMemberCount

$
0
0

Hello everybody ,

I have this code :

WString AdCellAltiPlaceTool::_GetNewNamedGroup(DgnModelRefP pModelRefP)
{

  static int numGroupSave = 0;
  MSElementDescrP ElmDscrNameGroupP = NULL;
  NamedGroupP namedGroupP = NULL;
  int numGroup = 1;
  UInt32     filePos = 0L;
  if (numGroupSave > numGroup)
  {
    numGroup = numGroupSave;
  }
  WChar nomGroup[MAX_NAMEDGROUP_NAME_LENGTH];
  Alm::Char::Sprintf(nomGroup, sizeof(nomGroup), L"%s%d", NOMGN_CELL_ALTI, numGroup);
  while (Alm::NamedGroup_findByName(&namedGroupP, &ElmDscrNameGroupP, &filePos, nomGroup, pModelRefP) == SUCCESS)
  {
    numGroup++;
    Alm::Char::Sprintf(nomGroup, sizeof(nomGroup), L"%s%d", NOMGN_CELL_ALTI, numGroup);
    int nbElement = 0;
    int nbGroupeOther = 0;
    StatusInt retour = mdlNamedGroup_getMemberCount(namedGroupP, &nbElement, &nbGroupeOther);
    if (nbElement == 0)
    {
      mdlNamedGroup_deleteFromFile(namedGroupP);
    }
    mdlNamedGroup_free(&namedGroupP);
    Alm::Basic::Elmdscr_freeAll(&ElmDscrNameGroupP);
  }
  Alm::Basic::Elmdscr_freeAll(&ElmDscrNameGroupP);
  numGroupSave = numGroup;
  mdlNamedGroup_free(&namedGroupP);
  return nomGroup;
}

In this function i found if i use 

StatusInt retour = mdlNamedGroup_getMemberCount(namedGroupP, &nbElement, NULL);

this way i got retour = -126 (MDLERR_BADARG)

But if i use StatusInt retour = mdlNamedGroup_getMemberCount(namedGroupP, &nbElement, &nbGroupeOther);

It works.

But the documentation says :

@param[out] graphicMembers number of graphic elements that belong to the Named Group. The caller can pass NULL if this count is not of interest.
* @param[out] groupMembers number of other Named Groups that belong to the Named Group. The caller can pass NULL if this count is not of interest.

did i miss something ? beacause i'm ok to use :

StatusInt retour = mdlNamedGroup_getMemberCount(namedGroupP, &nbElement, &nbGroupeOther);

But i want to be sure i did not use mdlNamedGroup_getMemberCount unproperly

In v8i i could use StatusInt retour = mdlNamedGroup_getMemberCount(namedGroupP, &nbElement, NULL);

Thanks


Viewing all articles
Browse latest Browse all 7260

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>