ApAddClass()

Indicate the widgets likely to be encountered in a widget database

Synopsis:

#include <Ap.h>

int ApAddClass( 
        char const * class_name_string,
        PtWidgetClassRef_t * const *wgt_class);

Arguments:

class_name_string
The name of the class (for example, "PtButton").
wgt_class
A predefined widget class; specify the name of the class preceded by an ampersand (for example, &PtButton).

Library:

Ap

Description:

This function lets you indicate which widget classes you're likely to encounter when you call ApOpenDBaseFile().

When you link your application, only those widgets it needs are linked into it. If you access widgets that aren't in your application because they're in an external database, you must add them to your internal class table so that they can be linked in at compile time.

Any widgets used when you build a PhAB application are automatically included in the internal class table (see the generated abmain.c file). When you use widgets from an external database, PhAB doesn't know which widgets you need to access, so you'll have to use this function to include them.

If you're loading a DLL that adds classes, you should call ApRemoveClass() to remove the classes before you unload the DLL.

Returns:

0
Success.
-1
There isn't enough memory to add the widget class, or you've already added a different widget class with the same name.

Examples:

base_setup ( ... )
{

    ApAddClass ("PtProgress", &PtProgress);
   
    return (Pt_CONTINUE);
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApOpenDBaseFile(), ApRemoveClass()

Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide