Programming Guide : Inter-Frame Communication Techniques : How You Can Communicate with an External Program Using External User Events : External User Event Demo
 
Share this page          
External User Event Demo
If you have installed the OpenROAD Development package, a sample is provided to demonstrate how external user events are used to facilitate the communication from a 3GL application to an OpenROAD application. The demo files are included in the following directory:
%II_SYSTEM%\ingres\w4glsamp\extevent
For instructions to use the demo, see the appropriate section, following, for your platform.
How the External User Event Demo Works on Windows
The directory %II_SYSTEM%\ingres\w4glsamp\extevent contains the following files:
extevent.exp
An export file of the OpenROAD application used to run the sample application
extevent.c, extev.h, extevent.rc
Source files for a non-OpenROAD executable
makefile
A makefile for building the external application
To use the demo application, you must perform the following basic steps:
1. Build the 3GL application.
2. Import the sample application into your database.
3. Run the sample application.
See the following sections for details on each of these steps.
Build the 3GL Application
You can build the 3GL application by setting environment variables and using the makefile to build the sample application.
To build the 3GL application
1. Set your PATH, LIB, and INCLUDE environment variables using the Microsoft compiler.
The II_SYSTEM environment variable should point to your OpenROAD installation.
2. Use the makefile to build extevent.exe:
nmake all
Import the Sample Application into Your Database
You can import the sample OpenROAD application by entering the following command at the command prompt:
w4gldev backupapp in dbname ExtEvent "%II_SYSTEM%\ingres\w4glsamp\extevent\extevent.exp"
Run the Sample Application
You can run the sample application by entering the following command at the command prompt:
w4gldev rundbapp dbname ExtEvent
The sample application starts.
To use the application
1. Click the Register Event button.
2. Click the Send menu button in the external application frame.
The ExtEvent demo frame displays a message that confirms that the event was received.
3. Click the UnRegister Event button in the ExtEvent demo.
4. Click the Send menu button again.
The OpenROAD application does not receive the external event.
How the External User Event Demo Works on UNIX or Linux
The directory $II_SYSTEM/ingres/w4glsamp/extevent contains the following files:
extevent.exp
An export file of the OpenROAD application used to run the sample application
exteventu.c
A source file for a non-OpenROAD executable
makefile
A makefile for compiling and linking the library file
To use the demo application, you must perform the following basic steps:
1. Build the 3GL application.
2. Import the sample application into your database.
3. Run the sample application.
See the following sections for details on each of these steps.
Build the 3GL Application
You can build the 3GL application by setting environment variables and using the makefile to build the sample application.
To build the 3GL application
1. Set your PATH and SHARED LIBRARY PATH environment variables to run OpenROAD.
The Mainwin runtime environment should also be initialized.
2. Use the makefile provided for your platform to compile exteventu.c:
cd $II_SYSTEM/ingres/w4glsamp/extevent
make
Import the Sample Application into Your Database
You can import the sample OpenROAD application by entering the following command on the command line:
w4gldev backupapp in dbname ExtEvent %II_SYSTEM%/ingres/w4glsamp/extevent/extevent.exp
Run the Sample Application
You can run the sample application by entering the following command at the command prompt:
w4gldev rundbapp dbname ExtEvent
The sample application starts.
To use the application
1. Click the Register Event button.
2. Click the Send menu button in the external application frame.
The ExtEvent demo frame displays a message that confirms that the event was received.
3. Click the UnRegister Event button in the ExtEvent demo.
4. Click the Send menu button again.
The OpenROAD application does not receive the external event.