ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Detecting Control Strip at Startup

Q Under Mac OS 8.5, when I call the Control Strip API at boot time the Mac crashes. I have verified that ControlStripDispatch is implemented. What is the source of the crash?

A Any extension calling the Control Strip software should be sure that the Control Strip exists and is loaded before it attempts to make any call to it. Just checking that ControlStripDispatch trap is implemented is insufficient.

Starting with Mac OS 8.5, Control Strip is an application and is not loaded at startup time. Therefore extensions cannot make Control Strip calls (such as SPBShowHideControlStrip) at startup time. Calling Control Strip routines when Control Strip is not running will cause a crash.

The proper way for an application or extension to determine if it is safe to call Control Strip is to use Gestalt with the gestaltControlStripAttr selector and check that the gestaltControlStripExists bit is set, which indicates that Control Strip and its complete API is available. The following code shows how to do this:

static Boolean IsControlStripAvailable (void) {
    OSStatus err;
    long response;

    err = Gestalt (gestaltControlStripAttr, response);
    if (response & (1 << gestaltControlStripExists)) {
        // It is safe to call Control Strip
        return true;
    } else {
        // It is not safe to call Control Strip
        return false;
    }
}

Updated: 19-Oct-98


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.