We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

`DisposableObject` in C++ API prior to Archicad 25?

Bitwreckage
Contributor

Hi,

 

In fixing a crash issue involving our implementation of a `DG::Palette` I found this post in a forum thread: How-to-make-a-Palette-dialog-by-C-Class , which helped me solve my issue... except, building for Archicad 24 and below fails.


It turns out that the header file `Support/Modules/GSRoot/DisposableObject.hpp` does not exist in the Archicad dev kit prior to version 25.

 

I downloaded the development kits for versions 25, 24 and 23 to see if there might be mention of how one is supposed to implement this Palette dialog in versions before 25. However, I found that the documentation in both version 24 and 23 mentions both `DisposableObject` and `DisposeHandler` in e.g. the description of `APIPaletteControlCallBackProc`.

Is the documentation for these old versions ahead of time, or are files missing from the SDK in these older versions?

And last but not least: Can we somehow get our code to compile (and work) the way it is now, or do I have to do a version split so that we do it the way we used to do for versions <25 and the "fixed way" on versions 25+?

 

-- 

 

Kind regards

 

Steffen Skov

dRofus

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hi Steffen,

 

There are other similar ways to make a DG::Palette without the DisposableObject class. I never used the DisposableObject class and from giving a quick look at the example I'm not yet convinced about any major benefits from it.

If I remember correctly, I started with the "DG_Test/OwnerDrawnListBoxPalette" example to get started with Palettes. This is already available in AC24 and I got it to work across several API/AC versions.


Hope that helps,
Bernd

View solution in original post

2 REPLIES 2
Solution

Hi Steffen,

 

There are other similar ways to make a DG::Palette without the DisposableObject class. I never used the DisposableObject class and from giving a quick look at the example I'm not yet convinced about any major benefits from it.

If I remember correctly, I started with the "DG_Test/OwnerDrawnListBoxPalette" example to get started with Palettes. This is already available in AC24 and I got it to work across several API/AC versions.


Hope that helps,
Bernd

Bitwreckage
Contributor

Thank you, Bernd!

 

This helped me on my way. I have now tested with both Archicad 22 and 27, and it seems to work wonderfully! Fingers crossed that the success continues with 28.

 

-- 

 

Kind regards

 

Steffen Skov
dRofus

 

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!