Hot Door CORE Forum

Full Version: steppers in floating dialogs crashes Windows (?)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Stepper widgets in floating dialogs work perfectly under Mac OS (10.13) for CC 2018, but under Windows 10 they appear to somehow lead to an exception where Illustrator thinks its current document is NULL. It's a pretty simple project with no platform-specific or SDK code.

The stepper calls one of two callbacks that adjust a value in increments of 1 (or 10 if shift key down), which in turn calls a function that redraws an art object to the revised parameters. Here Illustrator throws an exception when HDI_CORE_ILLUSTRATOR->CurrentDocument() returns NULL. When pressing cursor keys in text fields, this same series of callbacks and functions work normally on both platforms.

Is there anything I can do to help narrow down what's really happening? Thanks.
Nice catch Rick. When callbacks come in from the OS (i.e. from widget interactions) Illustrator must be "put in context" such that Ai SDK calls can do their jobs. Looks like we have a bug where the context is not being setup as it's supposed to be.

You can workaround this issue for now by calling the hdi::core::Illustrator::pushContext() method at the very top of your stepper callbacks, and subsequently call hdi::core::Illustrator::popContext() at the very end.
Thanks, Garrett! Now it works perfectly. I really appreciate your quick response and workaround. Smile