<?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 Attach to Process issues in VS 2022 / AC27 in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585251#M9112</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have problems attaching to ArchiCAD process in current VS/AC.&lt;/P&gt;
&lt;P&gt;Note that the problem is not stable, ie. sometimes (most times, unfortunately) happens but sometimes things work.&lt;/P&gt;
&lt;P&gt;For breakpoints I see the ordinary &lt;EM&gt;"The breakpoint will no currently be hit.&amp;nbsp;No Symbols have been loaded for this document." &lt;/EM&gt;The .pdb is written so on the VS side I think everything is as advertised.&lt;/P&gt;
&lt;P&gt;When I check the loaded modules (Debug/Windows/Modules window), mostly I don't see my .apx as a loaded module.&lt;/P&gt;
&lt;P&gt;Sometimes I see it, and guess, then breakpoints work then. (PS when I kind of enforce loading it through &lt;EM&gt;"Options/Add-On Manager..." &lt;/EM&gt;it loads more times successfully than ordinarily.)&lt;/P&gt;
&lt;P&gt;The life cycle of the addon is quite ordinary, I use the default Initialization (ie. I have copied it from an Example module) and the addon actually works as it should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// -----------------------------------------------------------------------------
// Called when the Add-On has been loaded into memory
// to perform an operation
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL	Initialize (void)
{
	GSErrCode err;
	err = ACAPI_Install_MenuHandler (32506, PropertyPalette);
	return err;
}		/* Initialize */&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only problem is that in most cases I don't see it in modules and I can't use breakpoints. As far as I understand this is a new AC27 issue (I haven't seen similar problems between AC18-AC26 that I have some experience of).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS2 a related problem is that many times I have no write right to the .apx (Getting &lt;EM&gt;LNK1104 cannot open file 'Build\Debug 27\PropertyPalette_27.apx'&lt;/EM&gt;&amp;nbsp;obviously because ArchiCAD sits on the file). Any ideas of being able to write the apx by, like, forcing to unload from ArchiCAD?&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 09:28:33 GMT</pubDate>
    <dc:creator>Sam Karli</dc:creator>
    <dc:date>2024-09-17T09:28:33Z</dc:date>
    <item>
      <title>Attach to Process issues in VS 2022 / AC27</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585251#M9112</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have problems attaching to ArchiCAD process in current VS/AC.&lt;/P&gt;
&lt;P&gt;Note that the problem is not stable, ie. sometimes (most times, unfortunately) happens but sometimes things work.&lt;/P&gt;
&lt;P&gt;For breakpoints I see the ordinary &lt;EM&gt;"The breakpoint will no currently be hit.&amp;nbsp;No Symbols have been loaded for this document." &lt;/EM&gt;The .pdb is written so on the VS side I think everything is as advertised.&lt;/P&gt;
&lt;P&gt;When I check the loaded modules (Debug/Windows/Modules window), mostly I don't see my .apx as a loaded module.&lt;/P&gt;
&lt;P&gt;Sometimes I see it, and guess, then breakpoints work then. (PS when I kind of enforce loading it through &lt;EM&gt;"Options/Add-On Manager..." &lt;/EM&gt;it loads more times successfully than ordinarily.)&lt;/P&gt;
&lt;P&gt;The life cycle of the addon is quite ordinary, I use the default Initialization (ie. I have copied it from an Example module) and the addon actually works as it should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// -----------------------------------------------------------------------------
// Called when the Add-On has been loaded into memory
// to perform an operation
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL	Initialize (void)
{
	GSErrCode err;
	err = ACAPI_Install_MenuHandler (32506, PropertyPalette);
	return err;
}		/* Initialize */&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only problem is that in most cases I don't see it in modules and I can't use breakpoints. As far as I understand this is a new AC27 issue (I haven't seen similar problems between AC18-AC26 that I have some experience of).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS2 a related problem is that many times I have no write right to the .apx (Getting &lt;EM&gt;LNK1104 cannot open file 'Build\Debug 27\PropertyPalette_27.apx'&lt;/EM&gt;&amp;nbsp;obviously because ArchiCAD sits on the file). Any ideas of being able to write the apx by, like, forcing to unload from ArchiCAD?&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 09:28:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585251#M9112</guid>
      <dc:creator>Sam Karli</dc:creator>
      <dc:date>2024-09-17T09:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Attach to Process issues in VS 2022 / AC27</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585529#M9122</link>
      <description>&lt;P&gt;Hi Sam,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It took me a while to get my head around the loading/unloading of Add-Ons and attaching the debugger.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what always works for me:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Unload Add-On from Archicad by unticking checkbox in Add-On Manager and confirm with OK.&lt;BR /&gt;This might prompt for saving and closing project depending on your Add-On. You need to confirm to properly unload the Add-On.&lt;/LI&gt;
&lt;LI&gt;Now you should be able to build the Add-On and overwrite the .apx file&lt;/LI&gt;
&lt;LI&gt;Attach the debugger to the Archicad process&lt;/LI&gt;
&lt;LI&gt;AFTER attaching the debugger, load the Add-On again by ticking the checkbox in the Add-On Manager and confirm with OK.&lt;BR /&gt;(This might again prompt for saving and reopening of the project if your Add-On is specified as &lt;STRONG&gt;APIAddOn_Preload&lt;/STRONG&gt;. - Need to confirm this again for proper loading)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;After that the VS Debugger should recognize that the Add-On is loaded in Archicad and you should be able to activate breakpoints etc.&lt;/P&gt;
&lt;P&gt;Let me know if this also works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a &lt;STRONG&gt;APIAddOn_Normal&lt;/STRONG&gt; and don't use any other techniques that require the Add-On to stay loaded in Archicad (so no Notification Manager, Element Observs, Paletts, etc. -- generally nothing that reacts on events by Archicad) then this often also works without the Unloading and Loading of the Add-On. This difference is where you might have seen the inconsistent behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But on the other hand, if you change certain things in resource files like menu strings, you even have to remove the Add-On from the Add-On Manager so that the &lt;STRONG&gt;Register Interface&lt;/STRONG&gt; function of your Add-On is executed again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;BR /&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 08:57:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585529#M9122</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2024-01-26T08:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attach to Process issues in VS 2022 / AC27</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585743#M9131</link>
      <description>&lt;P&gt;Hm, to be honest, I had never started/attached to an ArchiCAD like this (attaching the process and AFTER THAT loading the addon).&lt;/P&gt;
&lt;P&gt;BTW stuff works now, thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 09:19:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Attach-to-Process-issues-in-VS-2022-AC27/m-p/585743#M9131</guid>
      <dc:creator>Sam Karli</dc:creator>
      <dc:date>2024-01-29T09:19:23Z</dc:date>
    </item>
  </channel>
</rss>

