cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Streamline your workflows and master BIM coordination! Program starts April 28!

Archicad C++ API
About Archicad add-on development using the C++ API.

Exceptions calling GetUserId and GetOrganizationIds functions

Fermat
Contributor

I made some tests with GSID functions to get user ID and organization IDs but there are some issues.

This is the code:

 

GS::UniString userStr;
GS::UniString orgsStr;

auto gsid = ACAPI::CreateGSIDObject();
if (!gsid.IsErr())
{
    auto userId = gsid->GetUserId();
    if (userId.IsOk())
    userStr = *userId;

    auto userOrgs = gsid->GetOrganizationIds();
    if (userOrgs.IsOk())
    {
       for (const auto& userOrg : *userOrgs)
       {
          orgsStr += userOrg + ", ";
       }
    }
}


I tried this code on Windows in Archicad 27 and 28 with same behavior.

If there is no logged user in Archicad there is an exception when class
destructor of "userId" is called at the end.

 

If there is a logged user in Archicad instead userId is OK, but the line
"for (const auto& userOrg : *userOrgs)" raises an exception.

 

Thanks in advice

4 REPLIES 4

Does the same thing happen with both release and debug builds? And is this on macOS or Windows?

Ralph Wessel BArch
Central Innovation
Fermat
Contributor

The issue is only on Windows and happens with both debug and release versions.

Is your release build linking against any debug libraries, e.g. MSVCRTD.lib?

Ralph Wessel BArch
Central Innovation
Fermat
Contributor

No, no debug libraries linked in release version.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!