Community articleInitializing the Form Library
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

All applications that use the API functions must initialize the Form Library to ensure correct error and memory handling behavior. The sample application does this in a separate method calledinitialize. In turn, initialize calls the Form Library function IFSInitialize and passes it the name of the current program.
Define the initialize function to call the function IFSInitialize.IFSInitialize initializes the API environment.
      r_short initialize(void *theInstance)
   r_short initialize(theInstance)
      void *theInstance;
   r_error error;
   /* Call IFSInitialize. The parameters are:
      1. SampleAp : the name of the application being run.
      2. 1.0.0 : the version of the application being run.
      3. 2.6.0 : the version of the API to use by default.
      An error code will be returned if there is a problem. */
      error =IFSInitialize("SampleAp", "1.0.0", "2.6.0");
      if (error != OK)
         reportError("IFSInitialize error %hd.\n", (r_short)error);

Next topic:
Loading a Form