Use cases, Using an omtd control – MagTek OMTD 99875144 User Manual

Page 30

Advertising
background image

OMTD

OPOS

for

MagTek

Devices


24

Creates a viewport over the portion of the display given by the first four parameters. The
window size is given by the last two parameters. Valid window row values range from (0) to
(WindowHeight-1) and column values range from (0) to (WindowWidth-1).

DestroyWindow()

Destroys the current window. The characters displayed in its viewport are not changed.
CurrentWindow is set to window 0. The device window and the associated window properties
are updated.

RefreshWindow(LONG Window)

Changes the current window to Window, then redisplays its viewport. Neither the mapping of
the window to its viewport nor the window’s cursor position is changed.

USE CASES

Using an OMTD Control

Once an OMTD control has been installed and an application has created and linked to it, the
first action an application must take on the CO is to call its Open method passing it a device
name that is associated with the control object. The CO locates the corresponding SO and using
the system registry and calls CoCreateInstance passing the SO’s Programmatic GUID to create
the object. The CO then binds to the SO’s interfaces and invokes its OpenService method.

The CO initializes its properties as well as descriptions and version numbers of the OPOS
control layers. Additional class-specific properties may also be initialized.

Since several applications may have the same device open at the same time, an application must
gain exclusive access to the device by calling the Claim method. This method must be called
before some methods and properties may be accessed.

Before the application can use the device, it must set the DeviceEnabled property to TRUE.
This value brings the device to an operational state, while FALSE disabled the device. When a
device is disabled, any physical input from the device will be discarded until the device is
enabled.

An application uses the device by invoking various methods on the CO via the IDispatch
interface.

When an application has finished using the device, the Close method should be called to release
the device and associated resources. If the DeviceEnabled property is TRUE, then Close
disables the device. If the Claimed property is TRUE, the Close releases the lock.

Before exiting, an application should close all open OMTD Controls.

Advertising