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

Debug exceptions

Anonymous
Not applicable
I'm guessing ArchiCAD installs a low-level hook (I'm on Win 7) to catch exceptions. This makes it hard to identify where the problem occurs in the plugin, as AC takes over & displays call stack etc. Is there any way to switch this off for a debugging session?
3 REPLIES 3
Ralph Wessel
Mentor
MarkHenryC wrote:
I'm guessing ArchiCAD installs a low-level hook (I'm on Win 7) to catch exceptions. This makes it hard to identify where the problem occurs in the plugin, as AC takes over & displays call stack etc. Is there any way to switch this off for a debugging session?
Do you mean ARCHICAD is exiting without giving you a chance to debug at the point of failure? You can set the debugger to break at the point where an exception is thrown (and specify which types of exceptions you're interested in). Is that what you're after?
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Yes that's the problem I'm having. It will jump to AC's handler, even if I bracket an error in a try/catch block.

But you're right, I probably have to tweak my debug settings. I don't have them on "full" as there are a number of harmless first-chance exceptions thrown outside of my code.
Akos Somorjai
Graphisoft
Graphisoft
MarkHenryC wrote:
Yes that's the problem I'm having. It will jump to AC's handler, even if I bracket an error in a try/catch block.

But you're right, I probably have to tweak my debug settings. I don't have them on "full" as there are a number of harmless first-chance exceptions thrown outside of my code.

Hi,

ARCHICAD does install a low level exception handler, you can't do much about that.

Ralph's suggestion is the good one, just adjust your debugger to stop when an exception is thrown.

Having a local try-catch block should work; so in your case I think you have a different kind of exception (a non-C++ one), like an access violation.

Best, Akos