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