We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-01-24 10:15 AM - last edited on 2024-09-17 11:28 AM by Doreena Deng
Hi all,
I have problems attaching to ArchiCAD process in current VS/AC.
Note that the problem is not stable, ie. sometimes (most times, unfortunately) happens but sometimes things work.
For breakpoints I see the ordinary "The breakpoint will no currently be hit. No Symbols have been loaded for this document." The .pdb is written so on the VS side I think everything is as advertised.
When I check the loaded modules (Debug/Windows/Modules window), mostly I don't see my .apx as a loaded module.
Sometimes I see it, and guess, then breakpoints work then. (PS when I kind of enforce loading it through "Options/Add-On Manager..." it loads more times successfully than ordinarily.)
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.
// -----------------------------------------------------------------------------
// 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 */
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).
PS2 a related problem is that many times I have no write right to the .apx (Getting LNK1104 cannot open file 'Build\Debug 27\PropertyPalette_27.apx' obviously because ArchiCAD sits on the file). Any ideas of being able to write the apx by, like, forcing to unload from ArchiCAD?
)
Any ideas?
Thanks in advance.
Solved! Go to Solution.
2024-01-26 09:57 AM
Hi Sam,
It took me a while to get my head around the loading/unloading of Add-Ons and attaching the debugger.
Here's what always works for me:
After that the VS Debugger should recognize that the Add-On is loaded in Archicad and you should be able to activate breakpoints etc.
Let me know if this also works for you.
If you have a APIAddOn_Normal 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.
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 Register Interface function of your Add-On is executed again.
Hope that helps,
Bernd
2024-01-26 09:57 AM
Hi Sam,
It took me a while to get my head around the loading/unloading of Add-Ons and attaching the debugger.
Here's what always works for me:
After that the VS Debugger should recognize that the Add-On is loaded in Archicad and you should be able to activate breakpoints etc.
Let me know if this also works for you.
If you have a APIAddOn_Normal 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.
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 Register Interface function of your Add-On is executed again.
Hope that helps,
Bernd
2024-01-29 10:19 AM
Hm, to be honest, I had never started/attached to an ArchiCAD like this (attaching the process and AFTER THAT loading the addon).
BTW stuff works now, thanks.