API_Favorite_Get() fails
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-01-31
09:23 PM
- last edited on
2022-09-29
09:39 AM
by
Daniel Kassai
2020-01-31
09:23 PM
Hello,
I am trying to load a favourite by API_Favorite_Get() using an API_Favorite made with favorite’s name as string. It fails. Whereas if I pass the name out of the array names[0], it works. Why is this happening? Code snippet pasted below.
Thanks, Dushyant.
I am trying to load a favourite by API_Favorite_Get() using an API_Favorite made with favorite’s name as string. It fails. Whereas if I pass the name out of the array names[0], it works. Why is this happening? Code snippet pasted below.
Thanks, Dushyant.
GSErrCode err = NoError; GS::UniString favName; short count = 0; GS::Array<GS::UniString> names; err = ACAPI_Favorite_GetNum (API_ColumnID, APIVarId_Generic, &count, nullptr, &names); favName = "Column - Rectangular”; //favName = names[0]; // this actually is ‘Column - Rectangular' API_Favorite favorite (favName); ACAPI_WriteReport("API_Favorite - name: %s", false, favorite.name.ToCStr().Get()); favorite.memo.New (); err = ACAPI_Favorite_Get (&favorite); if (err != NoError) { ACAPI_WriteReport ("ACAPI_Favorite_Get failed (Name: %s)", false, favName.ToCStr().Get()); ACAPI_WriteReport ("err: %d", false, err); ACAPI_DisposeElemMemoHdls (&favorite.memo.Get ()); return; }
Labels:
- Labels:
-
Add-On (C++)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-03 01:34 PM
2020-02-03
01:34 PM
The error was:
Name of the column had a space at the end, so it should be: "Column - Rectangular ", for reference of others.
Name of the column had a space at the end, so it should be: "Column - Rectangular ", for reference of others.