Updated: May 06, 2022

Find a control by its name


#include <aoi.h>

const AOICtrl_t *AoFindName(const char *name,
                            const char *oiface,
                            int32_t version);


The name of the control you want to find, set in the control's Name interface.
The name of an interface that any returned control should contain, or NULL if you want to get the first control with a matching name from the global list.
The minimum version of the interface specified with the oiface argument; this is ignored if oiface is NULL.



This function finds a control that has the given name and if specified, an interface that has the given interface name and version. Controls are named only if they declare the Name interface in their interfaces list. Before the function returns, it increments the hold counter for the control, which loads the DLL into memory if it was not already loaded (assuming the control represents a DLL).


A pointer to an AOICtrl_t structure for a control that matches the search criteria, or NULL if no such control was found.


Here's an example of a Name interface declaration:

AOInterface_t pnm_idecoder_interface[] =
    { "Name", 0, "pnm_idecoder" },
    { "Description", 0, "PNM Image Reader" },
    { 0, 0, 0 },
If the above interfaces were added to the list of available interfaces, and you wanted to find the AOI control named pnm_idecoder, without specifying a particular interface that it must contain, you would write code like this:
AOICtrl_t *ctrl = AoFindName( "pnm_idecoder", NULL, 0 );
Now you can use the control to find specific interfaces.


QNX Neutrino