Make your own free website on
8.2.2 The RexxRegisterSubcomExe() function

This function is used to register a subcommand handler with the
interface. The subcommand handler must be a procedure located
within the code of  the application. After registration, the REXX
interpreter can execute subcommands by calling the subcommand
handler with parameters describing the subcommand.

The prototype for RexxRegisterSubcomExe() is:

     APIRET APIENTRY RexxRegisterSubcomExe(
           PSZ EnvName,
           PFN EntryPoint,
           PUCHAR UserArea
     ) ;

All the parameters are input, and their significance are:

          Points to an ASCII NUL terminated character string which
          defines the name of the environment to be registered.
          This is the same name as the REXX interpreter uses with
          the  ADDRESS clause in  order to select an external
          Points to the entrypoint of the subcommand handler
          routine for the environment to be registered. See the
          section on Subcommand  Handlers for more information.
          There is an upper limit for the  length of this name.
          Pointer to an 8 byte area of information that is to be
          associated  with this environment. This pointer can be
          NULL if no such  area is necessary.

The areas pointed to by  EnvName and  UserArea are copied to a
private area in the interface, so the programmer may de-allocate
or reuse the area used for these parameters after the call has

The RexxRegisterSubcom() returns an unsigned long, which carries
status information describing the outcome of the operation. The
status will be one of the RXSUBCOM values:

          The subcommand handler was successfully registered.
          The subcommand handler was successfully registered.
          There already existed another subcommand handler which
          was registered with RexxRegisterSubcomDll(), but this
          will be shadowed by the    newly registered handler.
          Due to some error, the handler was not registered.
          Probably because a handler for EnvName was already
          defined at a  previous call to RexxRegisterSubcomExe().
          The handler was not registered, due to lack of memory.
          Indicates that the handler was not registered, due to
          one or more of the parameters having invalid values.