<?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: Converting addon from xcode to visual studio in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329896#M1433</link>
    <description>&lt;P&gt;Hi Akos,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I definitely compiled&amp;nbsp; in x64.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I could find in the mdid folder of the binary is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mdidbin.jpg" style="width: 534px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/19099i19C2DE1742C6DFEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="mdidbin.jpg" alt="mdidbin.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Feb 2022 12:51:12 GMT</pubDate>
    <dc:creator>julienK</dc:creator>
    <dc:date>2022-02-14T12:51:12Z</dc:date>
    <item>
      <title>Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329871#M1431</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My office decided to switch from mac to pc so I have to recompile all my addons.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With a few minor tweaks i got my first one to compile in visual studio but can't load it in Archicad.&lt;/P&gt;&lt;P&gt;the extension manager says 'this file is an old addon that can't be used in this Archicad version'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its not an MDID error, and the same happens in demo and normal mode. The grc files compile without errors.&lt;/P&gt;&lt;P&gt;the only error i get in the log is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ACAP_STAT.lib(ACAPlib_.obj) : warning LNK4099: PDB 'API_c.pdb' could not be found with 'ACAP_STAT.lib(ACAPlib_.obj)' or in 'D:\Graphisoft API\00 Win64\API Development Kit 25.3002\Examples\JK_Test-3\Build\x64\Release\API_c.pdb'&amp;nbsp;; l'objet sera lié sans informations de débogage&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but this error appears also with the example addons.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I spent the whole weekend trying to find a solution but I'm stuck. I looked everywhere in the visual studio properties for a definition of the target Archicad version but couldn't find anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Archicad 25 4013, visual studio 2019 142 and I have the latest dev kit installed&amp;nbsp; 25.3002&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appriciated.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:03:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329871#M1431</guid>
      <dc:creator>julienK</dc:creator>
      <dc:date>2022-02-14T07:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329888#M1432</link>
      <description>&lt;P&gt;Hi Julien,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Couple of things come into my mind:&lt;/P&gt;
&lt;P&gt;- check if you are compiling a 64-bit version of the add-on&lt;/P&gt;
&lt;P&gt;- even though you have a valid MDID, open your built add-on in Visual Studio as Resources, and check if the MDID resource is really in the binary file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The warning you showed is not a problem, it doesn't effect the validity of the add-on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best, Akos&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 09:35:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329888#M1432</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2022-02-14T09:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329896#M1433</link>
      <description>&lt;P&gt;Hi Akos,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I definitely compiled&amp;nbsp; in x64.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I could find in the mdid folder of the binary is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mdidbin.jpg" style="width: 534px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/19099i19C2DE1742C6DFEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="mdidbin.jpg" alt="mdidbin.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 12:51:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329896#M1433</guid>
      <dc:creator>julienK</dc:creator>
      <dc:date>2022-02-14T12:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329897#M1434</link>
      <description>&lt;P&gt;Hi Julien,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This seems to be correct. Could you please send me (here, or mail it to asomorjai@graphisoft.com) your add-on? I'll check it here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best, Akos&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 13:03:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/329897#M1434</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2022-02-14T13:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/330045#M1435</link>
      <description>&lt;P&gt;Hi Julien,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have just sent the corrected add-on back to you. The reason why you add-on was not loading that a runtime exception was thrown while loading the .apx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exception thrown: read access violation.&lt;BR /&gt;this-&amp;gt;**content** was nullptr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Inline Frame] GSRoot.dll!GS::TSRefCounter::operator&amp;gt;(int) Line 105 C++&lt;BR /&gt;[Inline Frame] GSRoot.dll!GS::UniString::AboutToModify(unsigned int) Line 950 C++&lt;BR /&gt;GSRoot.dll!GS::UniString::Set(const char * chars, unsigned int logicalLength, unsigned int physicalLength, GSCharCode charCode) Line 707 C++&lt;BR /&gt;GSRoot.dll!GS::UniString::operator=(const char * cStr) Line 433 C++&lt;BR /&gt;&amp;gt; DG_Test.apx!`dynamic initializer for 'typoLims''() Line 74 C++&lt;BR /&gt;[External Code] &lt;BR /&gt;GSRoot.dll!GS::LoadModule(const wchar_t * modulePath) Line 30 C++&lt;BR /&gt;GSUtils.dll!IOUtil::ModuleFile::Load() Line 1267 C++&lt;BR /&gt;Archicad.exe!APIModule::Load() Line 115 C++&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the reason behind that is that you use a GS::UniString in a global variable; it took a while to figure that out:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your header file you declared a struct like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;typedef struct&lt;SPAN class="s1"&gt; {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p3"&gt;&lt;SPAN class="Apple-converted-space"&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p3"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;GS::UniString&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;T1;&lt;/P&gt;
&lt;P class="p4"&gt;...&lt;/P&gt;
&lt;P class="p5"&gt;&lt;SPAN class="s1"&gt;}&amp;nbsp;&lt;/SPAN&gt;typoLimits&lt;SPAN class="s1"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in your .cpp file you initialized a global variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;typoLimits&lt;/SPAN&gt; typoLims = {&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;typoLims.T1 &lt;SPAN class="s2"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;"T1"&lt;/SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;...&lt;/P&gt;
&lt;P class="p1"&gt;};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This doesn't work well, as GSRoot is not really loaded for your add-on at DLL initialization time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best, Akos&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 18:23:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/330045#M1435</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2022-02-15T18:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/330076#M1436</link>
      <description>&lt;P&gt;Thanks a lot Akos,&lt;/P&gt;&lt;P&gt;I don't know how I could have figured this out on my own.&lt;/P&gt;&lt;P&gt;that's actually the only bit of code I modified from xcode to visual studio. (adding the typolims before the "." in that struct for some reason xcode was happy with that but not visual studio. I think it has something to do with c++14.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it all makes sense to me one day, right now its pretty much 'throw something at the wall and see if it sticks kind of approach'.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 06:28:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/330076#M1436</guid>
      <dc:creator>julienK</dc:creator>
      <dc:date>2022-02-16T06:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting addon from xcode to visual studio</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/330077#M1437</link>
      <description>&lt;P&gt;Yeah, that was a tough one, glad I could help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to ask next time, that's what we are here for &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day, Akos&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 07:35:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Converting-addon-from-xcode-to-visual-studio/m-p/330077#M1437</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2022-02-16T07:35:11Z</dc:date>
    </item>
  </channel>
</rss>

