<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ACAPI_LibPart_SetDetails_ParamDef function signature in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289286#M2497</link>
    <description>Thanks for the clarification. We're aware that GSHandle is just a char** as well. We just didn't know whether we had to allocate an actual handle (-&amp;gt; BMAllocateHandle) or not. A pointer to pointer could also be a pointer to an array or an array of pointers. This gets especially confusing if the same function signature uses both variants API_AddParType** and later GSHandle at the same time. The type alias at least makes it clear that we need a proper handle.</description>
    <pubDate>Tue, 20 Oct 2020 09:26:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-20T09:26:35Z</dc:date>
    <item>
      <title>ACAPI_LibPart_SetDetails_ParamDef function signature</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289284#M2495</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;the function signature of ACAPI_LibPart_SetDetails_ParamDef looks like this:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;ACAPI_LibPart_GetSect_ParamDef (const API_LibPart *libPart, API_AddParType **addPars, double*a, double*b, GSHandle sect2DDrawHdl, GSHandle *sectionHdl, GS::UniString *password = nullptr);
&lt;/PRE&gt;
Why is the type of the 2nd argument API_AddParType**? It looks like the function is actually expecting a GSHandle. If we try to use anything other than a GSHandle, for example a local array, our code breaks. Unfortunately the documentation only says
&lt;BLOCKQUOTE&gt;[in] Additive parameters of the Library Part&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;which is not very helpful.&lt;BR /&gt;&lt;BR /&gt;Do we really need a GSHandle here? If so, are there other API functions that use such double pointers and expect a GSHandle?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:43:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289284#M2495</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T11:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_LibPart_SetDetails_ParamDef function signature</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289285#M2496</link>
      <description>A double pointer, or pointer to a pointer, is sometimes referred to as a "handle". GSHandle is is just an alias for the same thing, i.e. they are all actually synonymous. And yes, there are many more cases like this. You can use functions like &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;BMGetHandleSize&lt;E&gt;&lt;/E&gt; to get size allocated to the handle.</description>
      <pubDate>Mon, 19 Oct 2020 19:51:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289285#M2496</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2020-10-19T19:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_LibPart_SetDetails_ParamDef function signature</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289286#M2497</link>
      <description>Thanks for the clarification. We're aware that GSHandle is just a char** as well. We just didn't know whether we had to allocate an actual handle (-&amp;gt; BMAllocateHandle) or not. A pointer to pointer could also be a pointer to an array or an array of pointers. This gets especially confusing if the same function signature uses both variants API_AddParType** and later GSHandle at the same time. The type alias at least makes it clear that we need a proper handle.</description>
      <pubDate>Tue, 20 Oct 2020 09:26:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289286#M2497</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-20T09:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_LibPart_SetDetails_ParamDef function signature</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289287#M2498</link>
      <description>That's true - it's not so easy to distinguish – particularly if the documentation isn't explicit. Generally speaking, a pointer to a pointer will be allocated as a handle, but there are exceptions. Best approach is to look at the example code with the dev-kit and see what they do. Otherwise, you can only run tests by calling functions that expect a handle and see if they fail.</description>
      <pubDate>Tue, 20 Oct 2020 12:20:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-SetDetails-ParamDef-function-signature/m-p/289287#M2498</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2020-10-20T12:20:08Z</dc:date>
    </item>
  </channel>
</rss>

