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

Palette Window Instantly disappears

Dayiz
Booster

Dear GS-Community, 

 

I've been working on an AddOn, but im having trouble with the Palettes in ArchiCAD. I tried to copy code from DG_Test Example AddOn where a Palette was built (->OwnerDrawnListBox). But when i execute my AddOn, the Palette instantly disappears. When I compile and execute the example AddOn it works fine, but for my AddOn it doesn't. I copied the Code for "FreeData()" and "Initialize()" into the AddOnMain, but that also didn't make a difference.

How can the Example AddOn work but when i copy everything into my AddOn, it just disappears.

Did anyone had the same problem or knows whats going on?

I put my Code in a zip, you'll find my AddOnMain, my DialogTable and Graphisofts OwnerDrawnListBoxPalette.

Thanks for any Help

 

Kind Regards

Dayiz

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
kovacsv
Booster

I would try to replace the return value of CheckEnvironment from APIAddon_Normal to APIAddon_Preload. This will make your add-on preloaded which means it will be kept in the memory during the entire Archicad session. Normal add-ons are loaded/unloaded every time they used, so this can be the cause of your palette disappearing immediately (the add-on is just unloaded after the call).

View solution in original post

2 REPLIES 2
Solution
kovacsv
Booster

I would try to replace the return value of CheckEnvironment from APIAddon_Normal to APIAddon_Preload. This will make your add-on preloaded which means it will be kept in the memory during the entire Archicad session. Normal add-ons are loaded/unloaded every time they used, so this can be the cause of your palette disappearing immediately (the add-on is just unloaded after the call).

That worked, thank you!

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!