OposPosPrinter

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2435
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 525 times
Been thanked: 109 times
Contact:

OposPosPrinter

Post by danielmaximiliano »

Hola a todos: me trajeron una impresora térmica 3nStar modelo RPT005
La configure en Windows bajo el nombre RPT005 la cual me aparece cuando hago un SelectPrinter.
La pregunta es.... La instalación viene con dos OCX , uno llamado OposPosPrinter.ocx y OPoSCashDrawer.ocx
Alguien trabajó con estos OCX.. quiero usarlos con con la impresora fiscal hasar 715F pero necesito saber los métodos de dichos OCX

Hi everyone, I got a 3nStar thermal printer model RPT005
I configure it in Windows under the name RPT005 which appears to me when I do a SelectPrinter.
The question is .... The installation comes with two OCXs, one called OposPosPrinter.ocx and OPoSCashDrawer.ocx
Someone worked with these OCX .. I want to use them with the hasar 715F fiscal printer but I need to know the methods of said OCX
IMG_20210112_233437515_HDR.jpg
IMG_20210112_233437515_HDR.jpg (3.12 MiB) Viewed 1036 times
image sample
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
mol
Posts: 3458
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 283 times
Been thanked: 182 times
Contact:

Post by mol »

Maybe this printer can open cashdraw after finishing printing? Some kitchen/gastro printers can do that

User avatar
AUGE_OHR
Posts: 1220
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 226 times
Been thanked: 332 times

Post by AUGE_OHR »

hi,

there are different Tools to "view" a *.OCX

i use HTML Help COM Assistant
https://www.devcomponents.com/comassistant/

but do not expect too much ... it will not generate "Sample" or "Description"
it just show you Event, Property and Method so you get "Key-word" to do more search for Sample
have fun
Jimmy

franco
Posts: 548
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 29 times

Post by franco »

I have clients and myself using star and epson receipt printers. We mostly use Star, I like the best. I use a Star TSP100
To make the cutter work (if you have one) or cashdrawer which most star printers have a cash drawer cable outlet on bottom.
In my company file I have two fields. One is CASHDRAWER, the is CUTTER.
After the end of my print job before END PRINTPAGE.

Code: Select all

prline := prline+20
If CONTROLS->CUTTER = 'S'                                                  // S for Star ..... E for Epson
        @ prline, -5  print chr(27)+ chr(100)+chr(01)
endif
if CONTROLS CASHDRAWER = 'S'
        @ prline , -5 print chr(7)
endif

For the size on the body of receipt I use size 7
All The Best,
Franco
Canada

User avatar
danielmaximiliano
Posts: 2435
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 525 times
Been thanked: 109 times
Contact:

Post by danielmaximiliano »

Gracias a todos:
siguiendo el metodo que implemente para la impresora fiscal Hasar 715F registre los siguientes archivos, para registar se debe elevar los privilegios de administrador ya que solamente desde el cmd pude registrar solo los .dll
2021-01-13 18_53_45-Window.png
2021-01-13 18_53_45-Window.png (10.17 KiB) Viewed 932 times
al inicio incluyo lo siguiente

Code: Select all

#include 'hmg.ch'
#include 'HFCL.CH'
#define RPT005           'OPOS.POSPrinter.1.14'
dentro del codigo

Code: Select all

Procedure Ventas()
*----------------------------------------------------------------------------*
PUBLIC oOposPrinter
CreaRPT005( ) 

Code: Select all

*----------------------------------------------------------------------------*
procedure CreaRPT005()
*----------------------------------------------------------------------------*
Return
    IF ( oOposPrinter := CreateObject( RPT005 ) ) != NIL
despues seguire agregando las funciones y metodos que contiene el .ocx
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
Claudio Ricardo
Posts: 74
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina
Has thanked: 14 times
Been thanked: 35 times

Post by Claudio Ricardo »

Gracias Daniel...
Me será de gran ayuda ya que un cliente mío trabaja con dos impresoras 3nStar RPT005
Mi programa genera un .pdf que él imprime con Firefox o Sumatra (Solución de compromiso)
pero lo ideal sería imprimir directamente en la impresora.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.

User avatar
danielmaximiliano
Posts: 2435
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 525 times
Been thanked: 109 times
Contact:

Post by danielmaximiliano »

Claudio Ricardo wrote:
Wed Jan 13, 2021 10:34 pm
Gracias Daniel...
Me será de gran ayuda ya que un cliente mío trabaja con dos impresoras 3nStar RPT005
Mi programa genera un .pdf que él imprime con Firefox o Sumatra (Solución de compromiso)
pero lo ideal sería imprimir directamente en la impresora.
no da error pero no logro imprimir, algo no estoy haciendo bien. :?

Code: Select all

*----------------------------------------------------------------------------*
procedure CreaRPT005()
*----------------------------------------------------------------------------*
/* Technically, 
it's Open() / ClaimDevice() / DeviceEnabled = TRUE / DeviceEnabled = FALSE / ReleaseDevice() / Close(). 
Open() requests a handle to the named device, and should work if the device exists. 
Close() is the matching pair function, and it should be called when the device is no longer needed by the application. 
ClaimDevice() (previously known as ... */

    IF ( oOposPrinter := CreateObject( RPT005 ) ) != NIL
	        If ( oOposPrinter:open("RPT005") ) != NIL
			oOposPrinter:ClaimDevice(1000)
			oOposPrinter:AsyncMode     := .T.
			oOposPrinter:DeviceEnabled := .T.
			//oOposPrinter:ResultCode
			oOposPrinter:PrintNormal(2, "ddddddd")
			oOposPrinter:CutPaper(100)
			oOposPrinter:ReleaseDevice()
			oOposPrinter:Close()
	          lOpen := .T.
		      Ventas.STATUSBAR.Item(1) := 'Impresora ' + oOposPrinter:DeviceName + ' Conectada '
		    else 	
			  Ventas.STATUSBAR.Item(1) := 'Impresora desconocida ' 
           EndIf
    Else
		Msgbox ( ' No se puede inicializar la IMPRESORA ' , ' Mensaje de error !!! ' )
    endIf		
Return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
SALINETAS24
Posts: 505
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Has thanked: 50 times
Been thanked: 74 times

Post by SALINETAS24 »

danielmaximiliano wrote:
Wed Jan 13, 2021 11:20 pm
Claudio Ricardo wrote:
Wed Jan 13, 2021 10:34 pm
Gracias Daniel...
Me será de gran ayuda ya que un cliente mío trabaja con dos impresoras 3nStar RPT005
Mi programa genera un .pdf que él imprime con Firefox o Sumatra (Solución de compromiso)
pero lo ideal sería imprimir directamente en la impresora.
no da error pero no logro imprimir, algo no estoy haciendo bien. :?

Code: Select all

*----------------------------------------------------------------------------*
procedure CreaRPT005()
*----------------------------------------------------------------------------*
/* Technically, 
it's Open() / ClaimDevice() / DeviceEnabled = TRUE / DeviceEnabled = FALSE / ReleaseDevice() / Close(). 
Open() requests a handle to the named device, and should work if the device exists. 
Close() is the matching pair function, and it should be called when the device is no longer needed by the application. 
ClaimDevice() (previously known as ... */

    IF ( oOposPrinter := CreateObject( RPT005 ) ) != NIL
	        If ( oOposPrinter:open("RPT005") ) != NIL
			oOposPrinter:ClaimDevice(1000)
			oOposPrinter:AsyncMode     := .T.
			oOposPrinter:DeviceEnabled := .T.
			//oOposPrinter:ResultCode
			oOposPrinter:PrintNormal(2, "ddddddd")
			oOposPrinter:CutPaper(100)
			oOposPrinter:ReleaseDevice()
			oOposPrinter:Close()
	          lOpen := .T.
		      Ventas.STATUSBAR.Item(1) := 'Impresora ' + oOposPrinter:DeviceName + ' Conectada '
		    else 	
			  Ventas.STATUSBAR.Item(1) := 'Impresora desconocida ' 
           EndIf
    Else
		Msgbox ( ' No se puede inicializar la IMPRESORA ' , ' Mensaje de error !!! ' )
    endIf		
Return
Hola Daniel, una pregunta ingenua.. ¿has probado imprimir desde cualquier otro programa standard de Windows..?
No si desde oficce será posible, más que nada para verificar que esta correctamente instalada.

Un saludo,
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:

User avatar
danielmaximiliano
Posts: 2435
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 525 times
Been thanked: 109 times
Contact:

Post by danielmaximiliano »

SALINETAS24 wrote:
Thu Jan 14, 2021 5:33 pm


Hola Daniel, una pregunta ingenua.. ¿has probado imprimir desde cualquier otro programa standard de Windows..?
No si desde oficce será posible, más que nada para verificar que esta correctamente instalada.

Un saludo,
En Windows se agrega como impresora genérica y se instala sobre el puerto USB, se le asigna un nombre LDN y en base a ese Nombre se crea la conexión mediante el objeto OCX, la aplicación que viene con la impresora imprime perfecto , me costó hacer funcionar el OCX de la impresora fiscal hasar y está va por el mismo camino
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

franco
Posts: 548
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 29 times

Post by franco »

I may be off track here but I do not know what ocx does,
I have no problems with these printers. As I stated above. I have a company control file with one record.
For printers I only have 2 fields . mine are Invoiceport and reportport. The report is for everything that is not an invoice and is set to default in my case.
REPORT Textbox "DEFAULT" field reportport
The invoice printer could also be default if system is using only 1 printer. If large invoices are using custom made invoices I use another
regular laser printer or normal printer with a different name.
INVOICE Texbox "hplaser' field invoiceport
When using star I install star using all star drivers. I have in the passed installed with generic text driver (not sure now it`s been a while.
mainly for dos programs. I THINK THEY NEED A PARALLEL PORT or COM PORT.
When Star is is invoice printer
INVOICE Textbox "STAR100" field invoiceport
IN PRINT PROGRAM:
DI := controls->invoiceport
select printer DI .................

maybe this ????
Franco
All The Best,
Franco
Canada

Post Reply