Harbour OLE support

510 views
Skip to first unread message

Mariano Terraz

unread,
Jun 26, 2017, 9:06:21 AM6/26/17
to Harbour Users
Dear Colleagues,
            Based on Antonio Linares request, i need to submit this new topic in order to fix Harobur OLE support that seams to be failing when returning values from methods in the OCX, response from Methods are NIL.

Actual Version: Harbour 3.2.0dev (r1703231115)

Example:
----------------------------------------------------
Function Main()
Local oFiscal, nResp

oFiscal:= CreateObject("HasarArgentina.ImpresoraFiscalRG3561")
oFiscal:Conectar("127.0.0.1",)
nResp = oFiscal:AbrirDocumento(82) 
msginfo(nResp)  ----> Response NIL
-----------------------------------------

Information from OCX - Using OLE View
----------------------------------------------
HasarArgentina (Hasar Argentina)
-> dispinterface _ImpresoraFiscalIRG3561
-> Methods
-------> AbrirDocumento ------> [id(0x60030422)] RespuestaAbrirDocumento AbrirDocumento([in] TiposComprobante CodigoComprobante);
...
...
...
->typedef struct RespuestaAbrirDocumento -------> typedef [uuid(142CE193-45F9-4AE0-83B8-0174CB533ADC), version(1.0)]
struct tagRespuestaAbrirDocumento { [helpstring("NumeroComprobante")]
long NumeroComprobante;
} RespuestaAbrirDocumento;
-------------------------------------------

Based on OCX Method description, method AbrirDocuemento should returns a struct RespuestaAbrirDocumento defined inside the OCX that contains an attirbute NumeroComprobante as LONG. 

This the OCX download link in case you want to check it:

Comments from HASAR GROUP OCX Support
--------------------------------------------------------------------
Good Morning. After analyzing your code, and searching for information about the language, we confirm our suspicion.
The answer returns in a type of structure that is generated with the OCX. Harbor, fails to map this structure, and therefore, it comes empty.
Hasar OCX communication tool is an ActiveX object developed under COM technology, respecting Windows standards.
It can be registered and used seamlessly on Windows 32/64-bit. The only limitation can be imposed by the visual development environment, if any, that is used.
In this case, apparently, the language is not compatible with the tool. I recommend that you consult with the help desk in your environment.
--------------------------------------------------------------------

Example in Visual Basic - Working
-------------------------------------------------------
Dim hasar As HasarArgentina.ImpresoraFiscalRG3561 = New HasarArgentina.ImpresoraFiscalRG3561
Dim respabrir As HasarArgentina.RespuestaAbrirDocumento

respabrir = hasar.AbrirDocumento(HasarArgentina.TiposComprobante.Tique)
Debug.Print("Tique Nº =[" & respabrir.NumeroComprobante & "]")
--------------------------------------------
We should be able to receive the same OCX information.

Thanks in advance, any help will be appreciated.
Best regards Mariano Terraz

Diego Fazio

unread,
Jun 26, 2017, 2:31:00 PM6/26/17
to Harbour Users
Yo utilizo tOleAuto():New("HasarArgentina.ImpresoraFiscalRG3561") ya que con el CreateObject he tenido problemas...Inclusive aveces me devolvia que no encontraba los metodos.

Diego.

Mariano Terraz

unread,
Jun 26, 2017, 2:53:07 PM6/26/17
to harbou...@googlegroups.com
Hola Diego,
       Me podrias confirmar que los siguientes metodos estan bien invocados ? sigo obteniendo NIL como respuesta.(nResp)

 oFiscal:= tOleAuto():New("HasarArgentina.ImpresoraFiscalRG3561")
 nResp:=oFiscal:AbrirDocumento(82)
 msginfo(nResp)

Te devuelve bien las respuestas los metodos invocandolos de esa forma?
Que version de la libreria tOle esta usando?

Me serviría mucho un ejemplo de la creación del objeto y la correcta invocacion de un metodo... por ejemplo el abrirdocumento, que devolveria el numero de documento abierto.

Otro metodo que no logro hacer funcionar y que me es imprescindible es:
ImprimirTextoFiscal(oEstilo,"hola",48) 
como parametro espera oEstilo del tipo AtributosDeTexto, como creas la estructura oEstilo??

 estilo.Centrado = False
 estilo.DobleAncho = False
 estilo.BorradoTexto = False
 estilo.Negrita = False

Muchas gracias por la ayuda... espero algun dia funcione!
Atte. Mariano 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-users+unsubscribe@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/-Wed7dLOCzE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hugo Gsell

unread,
Feb 25, 2019, 5:26:38 AM2/25/19
to Harbour Users
Hola.
Quería saber si pudiste resolver estos 2 ìtems problemas que planteas:
1) el devolver el nro de comprobante a imprimir (o en su defecto el ultimo impreso segun tipo 
2) y el tema del estilo de la fuente... que necesito para pasar los datos a las zonas.
   Este item lo resolvi llamando a un programa externo en .net que pone esos datos.. y luego continuo desde mi app visual basic 6.


Hugo Gsell



El lunes, 26 de junio de 2017, 10:06:21 (UTC-3), Mariano Terraz escribió:
Reply all
Reply to author
Forward
0 new messages