Share

acedRegFunc

C++

int acedRegFunc(
    int (*fhdl) (void), 
    int fcode
);

File

acedads.h

Description

Registers an external function so that the ARX library can call it directly, bypassing the dispatch loop.

Note

The name in the fhdl argument is the name of the function as it appears in the application's code. This is not necessarily the same as the name string that was passed to acedDefun(). Also, a registered function handler must call acedGetArgs().

A function must be registered by acedRegFunc() if it is called by an acedInvoke() call initiated (directly or indirectly) by a function in the same application. Otherwise, the acedInvoke() call will fail. It is safest if you use acedRegFunc() to register all external functions meant to be called by acedInvoke(). If you use acedRegFunc() to register all of the external functions defined by your application, the kInvkSubrMsg case of the main() function's dispatch loop will always be bypassed and can be omitted (or will return RSRSLT).

An external function handler registered by acedRegFunc() must have no arguments and must return an integer--either RSRSLT or RSERR.

The acedRegFunc() call must follow a successful call to acedDefun(). If you attempt to register an undefined function, AutoLISP won't recognize the function's name, so the acedRegFunc() call has no effect.

A function can be unregistered by calling acedRegFunc() with a null fhdl and the fcode that was used to register it. The ARX application that uses acedRegFunc() to unregister a function must be the same program that originally called acedRegFunc() to register it.

The acedRegFunc() function returns RTNORM if successful; otherwise, it returns RTERROR.

Parameters

Parameters Description
fcode Integer code used to identify the function when it was defined by acedDefun()

Was this information helpful?