0
I am trying to use the pythonnet library to access the spring dll, so far I have been able to open the dll and use some of the basic functions of it, but now I am stuck trying to use the Abreempresatrabalho method.
import clr
clr.AddReference(r'dll\SG900\Interop.ErpBS900')
from Interop.ErpBS900 import ErpBS
motor = ErpBS
motor().AbreEmpresaTrabalho("2", "TESTE", "Primavera", "Primavera.123")
System.Runtime.InteropServices.COMException: REGISTO: Entrada HKEY_LOCAL_MACHINE\Software\PRIMAVERA\SGS900\DEFAULT\ADM não encontrada.
em Interop.ErpBS900.ErpBSClass.AbreEmpresaTrabalho(EnumTipoPlataforma& enuTipoPlataforma, String& strCodEmp, String& strUtilizador, String& strPassword, StdBETransaccao& objTrans, String& strInstancia, Boolean& blnModoPrimario)
This last line of the me error of regedit I think, but I do not know how to solve.
I do not know, but if you allow me a guess: There is a key in the Windows registry, it seems that the software is not installed.
– Paulo Marques
Hello, it was what I thought too but I have the spring installed in the machine where I am developing, however in regedit the keys are not stored in the same board. I tried to copy the structure, but it was no use. i have registered in regedit as follows: Computer HKEY_LOCA_MACHINE SOFTWARE Wow6432node Spring|SGP900 and when I try to use a dll function it asks me a different path HKEY_LOCAL_MACHINE SPRING SOFTWARE SGS900 DEFAULT ADM
– patrick arsenio
It’s running as an administrator?
– Paulo Marques
Hello, yes, I tried that already. I tried something else, I installed spring in a mauqina with windows 32 bits, I created the entries regedit by hand and I managed to get past that error, now I have another type of error and I have no idea what it might be.
IndexError: tuple assignment index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
 File "<input>", line 1, in <module>
SystemError: <bound method 'AbreEmpresaTrabalho'> returned a result with an error set
– patrick arsenio