Before using any of the functions of RapidLpt, the driver must be initialized with the help of the function OpenRapidLpt . It must be done once after starting the application. Also resources used by the driver should be cleaned up(driver closed) before the application is closed.
Schematic session of using RapidLpt:
| // initialize(open) the driver
|
| // Check if the driver initialized successfully
|
| //////////////////////////////////////
|
| ///////// RapidLpt session //////////
|
| ///////// ................ //////////
|
| //////////////////////////////////////
|
| // Free resources used by the driver (close the driver)
|
| // An error happened while opening the driver
|
| MessageBox("Cannot open the driver","Attention!", MB_OK | MB_ICONWARNING);
|
Driver can be initialized by many applications simultaneously, once for each LPT device. The parameter of OpenRapidLpt() can be used to select a device supported by RapidLpt driver.
|