SIMPOL Documentation

Using SMEXEC

There are three API functions that are provided in SMEXEC for allowing calls to SIMPOL functions from external applications and languages. Those three functions are:

  • SMExec_LoadSMPModule()

  • SMExec_UnloadSMPModule()

  • SMExec_RunSMPFunction()

The first of these functions is used to load a compiled SIMPOL program (either an SMP or an SML). The second is used to free that program and release the memory that it is using. The third is used to call a function in the program that was loaded. It is important that the return value from the load function be tested for success (0). If the load has failed, then none of the other functions should be called. Calling the unload function with an invalid handle can also result in a general protection fault (GPF).