Board index » cppbuilder » OPOS Activex Control

OPOS Activex Control


2006-10-06 10:37:13 PM
cppbuilder15
Hi all,
I am working on a shop project that uses IBM POS hardware - line display,
cash drawer, pos printer (reciept, slip, journal).
I am testing OPOS (OLE for POS) activex controls from
monroecs.com/opos.htm which are recommended by IBM.
I have trouble with OPOSPOSPrinter component.
Print command gets executed only if I set Sleep for 50 milliseconds, right
after PrintNormal command. Otherwise nothing is printed.
Application is running in single thread. But component alow asynchronous
print (AsyncMode property).
Has anyone experiance with this controls ? Why do I need sleep...
Delphi example:
try
POSPrinter.Open('PRINTERNAME');
POSPrinter.AsyncMode := True;
POSPrinter.ClaimDevice(1000);
POSPrinter.DeviceEnabled := True;
POSPrinter.PrintNormal(PTR_S_RECEIPT, WideString('TEST PRINT'));
//Sleep(50); // !!! IT DOES NOT PRINT
Sleep(50); // !!! OK
finally
POSPrinter.DeviceEnabled := False;
POSPrinter.ReleaseDevice;
POSPrinter.Close;
end;
Regards Milo
 
 

Re:OPOS Activex Control

Milo skrev:
Quote
Hi all,

I am working on a shop project that uses IBM POS hardware - line display,
cash drawer, pos printer (reciept, slip, journal).

I am testing OPOS (OLE for POS) activex controls from
monroecs.com/opos.htm which are recommended by IBM.

I have trouble with OPOSPOSPrinter component.

Print command gets executed only if I set Sleep for 50 milliseconds, right
after PrintNormal command. Otherwise nothing is printed.

Application is running in single thread. But component alow asynchronous
print (AsyncMode property).

Has anyone experiance with this controls ? Why do I need sleep...

Delphi example:

try
POSPrinter.Open('PRINTERNAME');

POSPrinter.AsyncMode := True;

POSPrinter.ClaimDevice(1000);
POSPrinter.DeviceEnabled := True;

POSPrinter.PrintNormal(PTR_S_RECEIPT, WideString('TEST PRINT'));
//Sleep(50); // !!! IT DOES NOT PRINT
Sleep(50); // !!! OK
finally
POSPrinter.DeviceEnabled := False;
POSPrinter.ReleaseDevice;
POSPrinter.Close;
end;

Regards Milo









The SO should fire the event OutputComplete when printing is finish and
there you can do the release and close.
--Christer
 

Re:OPOS Activex Control

Quote
The SO should fire the event OutputComplete when printing is finish and
there you can do the release and close.
--Christer
Yes it has OutputCompleteEvent
Thanks!
 

{smallsort}