<?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 BNZeromemory Error in Archicad 27 in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584809#M9104</link>
    <description>&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Hello everyone.&lt;/DIV&gt;
&lt;DIV class=""&gt;I have this error when I use functions for ArchiCAD 26 to Archicad 27.&lt;/DIV&gt;
&lt;DIV class=""&gt;The functions are used for creating attributes, properties, walls, and slabs.&lt;/DIV&gt;
&lt;DIV class=""&gt;It is working well in Archicad 26 but there is such error in Archicad 27.&lt;/DIV&gt;
&lt;DIV class=""&gt;If anyone has an opinion or experience with this error, please help me.&lt;/DIV&gt;
&lt;DIV class=""&gt;----------------------------error----------------------------------------------&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;LI-CODE lang="cpp"&gt;Static assertion failed due to requirement 'GS::IsVoid&amp;lt;API_ServerApplicationInfo&amp;gt; || GS::IsTriviallyCopyable&amp;lt;API_ServerApplicationInfo&amp;gt;': The parameter of BNZeroMemory should be trivially copyable.&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 09 Sep 2024 09:26:42 GMT</pubDate>
    <dc:creator>mick-donald</dc:creator>
    <dc:date>2024-09-09T09:26:42Z</dc:date>
    <item>
      <title>BNZeromemory Error in Archicad 27</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584809#M9104</link>
      <description>&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Hello everyone.&lt;/DIV&gt;
&lt;DIV class=""&gt;I have this error when I use functions for ArchiCAD 26 to Archicad 27.&lt;/DIV&gt;
&lt;DIV class=""&gt;The functions are used for creating attributes, properties, walls, and slabs.&lt;/DIV&gt;
&lt;DIV class=""&gt;It is working well in Archicad 26 but there is such error in Archicad 27.&lt;/DIV&gt;
&lt;DIV class=""&gt;If anyone has an opinion or experience with this error, please help me.&lt;/DIV&gt;
&lt;DIV class=""&gt;----------------------------error----------------------------------------------&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;LI-CODE lang="cpp"&gt;Static assertion failed due to requirement 'GS::IsVoid&amp;lt;API_ServerApplicationInfo&amp;gt; || GS::IsTriviallyCopyable&amp;lt;API_ServerApplicationInfo&amp;gt;': The parameter of BNZeroMemory should be trivially copyable.&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Sep 2024 09:26:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584809#M9104</guid>
      <dc:creator>mick-donald</dc:creator>
      <dc:date>2024-09-09T09:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: BNZeromemory Error in Archicad 27</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584842#M9105</link>
      <description>&lt;P&gt;Earlier every Archicad struct was a POD type, so it was safe - and actually recommended - to call&amp;nbsp;BNZeroMemory on them to initialize the object. Since the API is getting more and more modern, now there are some non-POD objects where it is not safe to zero the memory since it will corrupt the data structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error you get means that you shouldn't call&amp;nbsp;BNZeroMemory on the&amp;nbsp;API_ServerApplicationInfo struct anymore. So you can safely skip the&amp;nbsp;BNZeroMemory call since the constructor will do the initialization.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may still want to call&amp;nbsp;BNZeroMemory if you are targeting older Archicad versions, in this case this code will do the trick:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_ServerApplicationInfo appInfo = {};
#ifndef ServerMainVers_2700
    BNZeroMemory (&amp;amp;appInfo, sizeof (appInfo));
#endif&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 19:38:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584842#M9105</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2024-01-21T19:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: BNZeromemory Error in Archicad 27</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584905#M9107</link>
      <description>&lt;P&gt;Actually this code is redundant&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#ifndef ServerMainVers_2700
    BNZeroMemory (&amp;amp;appInfo, sizeof (appInfo));
#endif&lt;/LI-CODE&gt;&lt;P&gt;I've been using initializer list instead of&amp;nbsp;BNZeroMemory or templated&amp;nbsp;BNClear and it works fine since AC24 (I haven't tried with AC23 and older versions). Also, since C++ 11 the equal sign is optional, i.e.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;API_ServerApplicationInfo appInfo{};&lt;/LI-CODE&gt;&lt;P&gt;is enough.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 10:49:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/BNZeromemory-Error-in-Archicad-27/m-p/584905#M9107</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2024-01-22T10:49:34Z</dc:date>
    </item>
  </channel>
</rss>

