ACAPI_​Install_​FileTypeHandler

Installs a callback procedure for handling file operations.

    GSErrCode  ACAPI_Install_FileTypeHandler (
        GSType                cmdID,
        APIIOCommandProc*     handlerProc
    );

 

Parameters

cmdID
[in] An identifier of the file type to install the callback procedure for. This should be the same what you used in the ACAPI_Register_FileType as a reference number in the RegisterInterface function.
handlerProc
[in] The callback function to handle the different file operations.

 

Return Values

NoError
The function has completed with success.

For other common API errors see the API Errors document.

 

Remarks

This function should be called in the Initialize function of your add-on. It installs the callback function which is called when the user chooses your registered file format in one of the Open/Save/Merge dialogs.

 

Example


// -----------------------------------------------------------------------------
// Called when the add-on has been loaded into memory
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL  Initialize (void)

{
    GSErrCode    err = NoError;

    err = ACAPI_Install_FileTypeHandler (1, APIIOCommandProc);

    return err;
}   // Initialize

 

Requirements

Version: API 4.1 or later
Header: ACAPinc.h

 

See Also

APIIOCommandProc
ACAPI_Register_FileType
API Functions