Jump to content

Function IDs in 24U's Plugin Template


Chuck
 Share

This topic is 2220 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have found the 24U plugin template to be quite useful in porting a plugin that was originally built for Windows, but one issue I've come across is that the function IDs need to match the existing Windows version instead of working sequentially.

In an attempt to make this happen, I added a `#define` for each of the plugin functions in FMTConfig.h, such as:

#define FUNCTION_1_ID             15007

Then I changed the lines in FMTemplate.cpp to read like this:

err = RegisterExternalFunction( FUNCTION_1_ID, FUNCTION_1_PARAMS, regFunction1Flags, FUNCTION_1_C_NAME );
...
UnRegisterExternalFunction( FUNCTION_1_ID );
....
(void) fmx::ExprEnv::UnRegisterExternalFunction(*pluginID, FUNCTION_26_ID );

One function, the second one, retains the default ID, so it reads

#define FUNCTION_2_ID             2

Anyone familiar with the template has probably already guessed what has happened. That second function is the only one that is useable in FileMaker. The rest of the functions have blank lines in the function list of the calculation dialog box.

I think this is related to the myplc.c and 24u_plist_compiler.sh files, but can't quite figure out what needs to be changed. I *think* I might need to edit FMTemplate.plc, but that doesn't seem right, since it hasn't been edited to this point and only includes the strings generation code for the first 10 functions (there are 26 functions at this point).

Just to try it out, I attempted to directly edit the strings file after the plugin was built, but this didn't help, or more properly, I wasn't sure what edits to make.

So, if I *need* to have my first function have a function ID of 15007 instead of 1, what else do I need to change?

Thanks,
Chuck

Edited by Chuck
Link to comment
Share on other sites

This topic is 2220 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.