Community articleInitializing the Form Library
Added by IBM contributorIBM on May 6, 2011
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.

   #ifndef OLD_STYLE_PARAMS
      r_short initialize(void *theInstance)
   #else
   r_short initialize(theInstance)
      void *theInstance;
   #endif
   {
   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);
         return(NOTOK);
      }
      return(OK);
   }


Parent topic: Developing an application in C
Previous topic: Setting Up Your Application
Next topic: Loading a Form