BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Archicad C++ API
About Archicad add-on development using the C++ API.

Add-on suddenly stops working

Anonymous
Not applicable
I've been working on an Add-on for AC9. Going fine, starting to get the hang of the ACAPI (and C++ 😉 ). Suddenly, ArchiCAD is telling me that the Add-on cannot be loaded. Checking in the Add-on manager, I see:

The file is either not an Add-On or an outdated one that cannot be used with this ArchiCAD version.

I haven't touched the resource files since it last worked, I have all of the required functions in place, and it compiles without error. The AddOnAdmin tool doesn't tell me anything useful, it just won't authenticate it.

I've had this happen before while I was getting started. I ditched that Add-On to get around it. That's not a good solution this time....
15 REPLIES 15
Karl Ottenstein
Moderator
Ramblin wrote:
The AddOnAdmin tool doesn't tell me anything useful, it just won't authenticate it.
When you open AddOnAdmin, and load your compiled apx file under the Check tab ... what do you see? You should see a tree structure with green check marks in front of everything. Will it not even let you get that far (when you say "won't authenticate"?)

Karl

PS And, I assume you have only the 6.1 SDK installed?
One of the forum moderators
AC 27 USA and earlier   â€¢   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
Right, by won't authenticate,I mean it doesn't do/show anything. Generally, I would think this is because of a bad MDID combo, but I've been using them with no problem and just for kicks I started another project and used the same numbers- works fine. I *wish* it would tell me about what errors it encounters trying to load it.

Honestly, I can't think of what I did to change it. I even diffed with older versions. Nothing but function internals has changed AFAICT (can tell)- mostly stripping them out because I changed to a more modular architecture.

BTW, VS.NET 2003. I've been using the Add-On wizard to get them started.

I just wish I knew what ArchiCAD looks at when it loads to determine that it's not a valid, or outdated, Add-on.
Anonymous
Not applicable
Yes, only the 6.1 SDK

Thanks for taking even a few minutes to look at this. If nothing can be done, I imagine I can get around it by starting a new proj and moving my code, but this isn't the first time so I'd like to know what I'm doing wrong...
Karl Ottenstein
Moderator
Ramblin wrote:
Right, by won't authenticate,I mean it doesn't do/show anything. Generally, I would think this is because of a bad MDID combo,
No, even a bad MDID combo will show something in the AddOnManager app.

I just tried loading an 8.0 add-on in it, and it at least displays the path name of the add-on in grey and a message "DevKit Version: Undefined..."

So, just as a guess it seems that your file is not being recognized as an add-on at all, which suggests a linkage problem. The head scratcher is that you said you hadn't changed any of the build settings since starting off with the appwizard.

Try a full clean and rebuild if you haven't. The only glitch I ever had with the API build settings was with one dependence not being correct for a re-make, and a clean build at least got me a successful link.

Also, right-mouse/properties your apx file in Windows Explorer and check the version info. If you don't have a Version tab, then that also suggests a bad build...either from the grc or linker.

Sorry this is not much help. If you don't want to go through the myriad settings dialogs one by one, your idea of merging your files into a new appwizard project might be the easiest ... but since this has happened to you more than once, it would sure be good to figure out what the problem is! 😉

Karl
One of the forum moderators
AC 27 USA and earlier   â€¢   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Ralph Wessel
Mentor
Ramblin wrote:
I've been working on an Add-on for AC9. Going fine, starting to get the hang of the ACAPI (and C++ 😉 ). Suddenly, ArchiCAD is telling me that the Add-on cannot be loaded. Checking in the Add-on manager, I see:
The file is either not an Add-On or an outdated one that cannot be used with this ArchiCAD version.
I recommend Karl's suggestion to do a clean and full rebuild. It may help to manually delete all the object files to ensure there are no left-overs. We have had this situation occur a few times, and this procedure fixed it in almost every case.

Otherwise, double-check that the resources for the MDID are actually linked into the finished build. Also, check the export lists for the project (refer to the Compilation and Linking Issues section in the devkit documentation if you need more info).

It's also worth making a debug build and setting breakpoints in the main entry points into your add-on, e.g. CheckEnvironment, RegisterInterface, Initialize, FreeData. See if these are called at all and - if they are - check that the initialisation is successful.
Ralph Wessel BArch
Anonymous
Not applicable
Well, at least it sounds like I've been checking the right things. I tried setting breakpoints on entry/exit points. I've cleaned and built, cleaned and rebuilt....no luck. I used /VERBOSE for the linker, but I still can't see where either project- the generic one that works or mine that doesn't- actually links to the grc/rc2 file that holds my MDID. I see it compile the localized/non-localized GRCs to GRC.RC2s without error, though.

There is no version tab on the broken apx.
Andras Babos
Graphisoft Alumni
Graphisoft Alumni
Ramblin wrote:
There is no version tab on the broken apx.

Looks like somehow the version resource disappeared from your Add-On. Try creating a fresh Add-On with the wizard and copy the 'VERS' resource in the grc files into your original project.
Does this help?
Anonymous
Not applicable
I went ahead and started a new project and added my code to that. It didn't take too long and it's working fine now.

I did pay attention to what I was changing in the resource files as I moved code. The only thing different in the *Fix.grc was that I changed the 1/1 MDID to my real one. In the other grc I added my menus. The VERS resource stayed the same.

The only thing I can think is something odd like Karl alluded to- that I did some operation that polluted it somehow- perhaps an unusual Rebuild setting- and maybe I missed something while cleaning the project.

I don't understand why the AddOnAdmin wouldn't tell me anything about the Add-On or the problems it encountered trying to check it. Anyone know what might cause this?
Karl Ottenstein
Moderator
Ramblin wrote:
I don't understand why the AddOnAdmin wouldn't tell me anything about the Add-On or the problems it encountered trying to check it. Anyone know what might cause this?
I assume that AddOnAdmin checks some basic info to make sure the file "looks" like an add-on. From what Andras said, perhaps this is the VERS info block. Just as Unix/Mac store 'magic numbers' to identify file types, I would guess that without the magic code, AddOnAdmin assumes the file is not an add-on and ignores it...

It's been so long that I can't remember how/where to do it, but there is some kind of option in VS to create an external makefile. If you find that, try creating makefiles for your old and new projects and doing a diff on them...?

Karl
One of the forum moderators
AC 27 USA and earlier   â€¢   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!