Workbench User Guide : Adding Other Components to Your Application : 3GL Sample Application : How the 3GL Sample Application Works on Windows
 
Share this page          
How the 3GL Sample Application Works on Windows
The directory %II_SYSTEM%\ingres\w4glsamp\3gl contains the following files:
test_3gl.exp
Is an export file of the OpenROAD application used to run the sample 3GL procedure
samp3gl.c
Is the sample 3GL source
samp3gl.def
Is the module definition file for building a DLL
makefile
Is the makefile for compiling and linking a DLL
To use the demo application, you must perform the following basic steps:
1. Import the sample application into your database.
2. Build the sample application.
3. Set up the run environment for the sample application.
4. Run the sample application.
See the following sections for details on each of these steps.
Import the Sample Application into Your Database
Import the test application into your database by entering the following command at the command prompt:
w4gldev backupapp in dbname test_3gl "%II_SYSTEM%\ingres\w4glsamp\3gl\test_3gl.exp"
dbname
Specifies the name of the database into which you are importing the test_3gl application
Build the Sample Application
You can build the 3GL application by importing it into your database, making an application image using the MakeImage utility, and using the makefile to build the sample application.
To build the sample application
1. Make an application image using the MakeImage utility, using "test_3gl.img" as the image name.
Note:  You may skip this step if you want to run the application directly from OpenROAD Workbench.
2. Use the makefile provided to compile samp3gl.c and link the DLL (samp3gl.dll):
cd %II_SYSTEM%\ingres\w4glsamp\3gl
nmake /f makefile all
More information:
Use the MakeImage Utility
How You Can Set Up the Run Environment
Ensure that OpenROAD can find samp3gl.dll. There are two ways to do this:
Set the environment variable II_LIBU3GL to point to the location of samp3gl.dll.
You may do this either by setting the Windows environment variable, II_LIBU3GL, or by using the ingsetenv command:
ingsetenv II_LIBU3GL %II_SYSTEM%\ingres\w4glsamp\3gl\samp3gl.dll
Whether you set the Windows environment variable or use ingsetenv, you must specify the full path if the directory where you placed the dll is not in the search path.
If you want to use a variable other than II_LIBU3GL, set that variable the same way you would set II_LIBU3GL, but remember you must run the application with the -m flag.
Ensure that samp3gl.dll is in a directory that is in your search path.
All the 3GL procedures in the test_3gl application are defined as being in samp3gl.dll. If the DLL is in the search path, OpenROAD will find it when you run the application.