48 FileMaker Pro Advanced Development Guide
12. Continue to build the formula then and click OK when you’re
done.
13. Click OK to close the Define Database dialog box.
Customizing the plug-in example
The plug-in example in FileMaker Pro Advanced is designed to be
easily modified so you can add your own custom functions. You need
to modify the following items:
1 version information in FMPluginExample.strings and
FMPluginExample.rc
1 plug-in and function names in FMPluginExample.strings and
FMPluginExample.rc
1 configuration function in FMPluginPrefs.cpp
1 external function definitions and coding in
FMPluginFunctions.cpp
Customizing the example resources
You must make the following modifications to the plug-in resource
files to create a custom external function plug-in:
1 Modify the version variables and strings to meet your needs.
1 Revise the configuration dialog box to meet your needs.
1 Specify the correct option string values.
1 Edit plug-in names and description.
1 Define your function names and function prototypes.
Customizing FMPluginExample.cpp
Make your modifications to the FMPluginExample.cpp in the
functions listed in the following table.
Customizing FMPluginPrefs.cpp
This file contains the Do_PluginPrefs function for the implementa-
tion of the configuration dialog box. Revise or remove this code as
needed.
Customizing FMPluginFunctions.cpp
Revise or remove the functions provided in the
FMPluginFunctions.cpp file and define your own. Do_PluginInit
refers to these functions when evaluating external functions in
calculations.
Function name Customization
Do_PluginInit Provide your own unique plug-in ID for “pluginID.”
Register each function, providing its name,
description, and function to be used. Call
fmx::ExprEnv::RegisterExternalFunction to
register your functions.
Do_PluginIdle Add any idle processing your plug-in needs.
Do_PluginShutdown Revise the UnRegisterExternalFunction calls to
reverse the registration done in Do_PlugInit. Call
fmx::ExprEnv::UnRegisterExternalFunction to
unregister your functions.