![]() | ![]() |
Home |
|
|
|
| Chapter 2: The Embedded SQL Interface |
|
| Database examples |
|
| Windows NT Service examples |
The example programs cur.sqc and dcur.sqc, when compiled for Windows NT, run optionally as services.
The two files containing the example code for NT services are the source file ntsvc.c and the header file ntsvc.h. The code allows a linked executable to be run either as a regular executable or as an NT service.
Start Sybase Central, and open the Services folder.
Select a service type of Sample Application, and click OK.
Enter a service name in the appropriate field.
Select the sample program (curwnt.exe or dcurwnt.exe) from the cxmp subdirectory of the installation directory.
Click OK to install the service.
Click Start on the main window to start the service.
When run as a service, the programs display the normal user interface if possible. They also write the output to the Application Event Log. If it is not possible to start the user interface, the programs print one page of data to the Application Event Log and stop.
These examples have been tested with the Watcom C/C++ 10.5 compiler and the Microsoft Visual C++ 2.0 compiler.
|
|