Boa tarde, amigos..
Estamos buscando conhecer mais sobre esse sistema e estamos com uma dúvida grande aqui...
É possível rodar macro de Excel/VBA junto com esse programa?
Se sim, como fazer o VBA identificar o programa?
Pois não consigo efetuar essa conexão, se alguém puder me ajudar, ficarei muito grato.
Autor: Vladimir Barros Seidel
4141 comentários
Private Const HLLAPI_CMD_CONNECTPS = 1
Private Const HLLAPI_CMD_DISCONNECTPS = 2
Private Declare Function hllapi Lib "libhllapi.dll" ( _
ByVal funcao As Integer, _
ByVal buff As String, _
ByVal comprimento As Integer, _
ByVal rc As Long) As Integer
Sub teste()
Dim s As String
s = space(1000)
x = hllapi(HLLAPI_CMD_CONNECTPS, s, 1000, 1)
End Sub
Declare Function hllapi_init Lib "libhllapi.dll" (ByVal tp as string) as Long
Declare Function hllapi_deinit Lib "libhllapi.dll" () as Long
Declare Function hllapi_get_revision Lib "libhllapi.dll" () as Long
Declare Function hllapi_connect Lib "libhllapi.dll" (ByVal uri as string) as Long
Declare Function hllapi_disconnect Lib "libhllapi.dll" () as Long
Declare Function hllapi_wait_for_ready Lib "libhllapi.dll" (ByVal timeout as Integer) as Long
Declare Function hllapi_get_screen_at Lib "libhllapi.dll" (ByVal row as Integer, ByVal col as Integer, ByVal text as String) as Long
Declare Function hllapi_enter Lib "libhllapi.dll" () as Long
Declare Function hllapi_get_message_id Lib "libhllapi.dll" () as Long
Declare Function hllapi_set_text_at Lib "libhllapi.dll" (ByVal row as Integer, ByVal col as Integer, ByVal text as String) as Long
Declare Function hllapi_cmp_text_at Lib "libhllapi.dll" (ByVal row as Integer, ByVal col as Integer, ByVal text as String) as Long
Declare Function hllapi_wait Lib "libhllapi.dll" (ByVal timeout as Integer) as Long
Declare Function hllapi_pfkey Lib "libhllapi.dll" (ByVal keycode as Integer) as Long
Declare Function hllapi_pakey Lib "libhllapi.dll" (ByVal keycode as Integer) as Long Sub Main if hllapi_init("") <> 0 then
print "Erro ao inicializar a biblioteca"
Exit Sub
End If hllapi_connect("fandezhi.efglobe.com:23") if hllapi_wait_for_ready(60) <> 0 then
print "Conexão não se estabilizou no tempo esperado"
Exit Sub
End If Dim text as string text = space(2000)
if hllapi_get_screen_at(1,1,text) <> 0 then
print "Erro ao tentar obter conteudo do terminal"
Exit Sub
End If
print text hllapi_disconnect()
hllapi_deinit() End Sub
Dim text As String
text = hllapi_get_screen_at(4, 2, 44) Range("A1").Value = text
Call hllapi_disconnect()
Call hllapi_deinit() End Sub Será que pode me dar alguma luz? Abraço
Dim text As String
text = hllapi_get_screen_at(4, 2, 44)
Range("A1").Value = text
Call hllapi_disconnect()
Call hllapi_deinit()
Dim text As String text = space(44) if hllapi_get_screen_at(4, 2, text) <> 0 then print "Erro ao tentar obter conteudo do terminal"
Exit Sub
End If Range("A1").Value = text
Call hllapi_disconnect() Call hllapi_deinit()
Declare Function hllapi_connect Lib "libhllapi.dll" (ByVal uri as string, ByVal wait as Integer) as Long
Declare Function hllapi_is_connected Lib "libhllapi.dll" () as Long
(...) hllapi_connect("fandezhi.efglobe.com:23",0)
Do While hllapi_is_connected() = 0
hllapi_wait(1)
Loop
Informo que consegui fazer a captura da tela do IBM com a funcão hllapi_get_screen(pos, text, tamanho)
Para funcionar é necessário executar o PW3270 previamente. Abraço,
Antônio Jorge
O arquivo a seguir não foi localizado: hllapi.dll" Já copiei o arquivo "hllapi.dll" para as pastas do PATH e não resolveu... Tem alguma idéia? Essa revisão 2778 é a mais nova?
O script de exemplo (que você listou nesse tópico) funciona com essa revisão do PW3270? Agradeço desde já. Rem ***** BASIC *****
Rem Inicializa a biblioteca Declare Function hllapi_init Lib "hllapi.dll" (ByVal tp As String) As Long
Declare Function hllapi_deinit Lib "hllapi.dll" () As Long
Declare Function hllapi_get_revision Lib "hllapi.dll" () As Long
Declare Function hllapi_connect Lib "hllapi.dll" (ByVal uri As String) As Long
Declare Function hllapi_disconnect Lib "hllapi.dll" () As Long
Declare Function hllapi_wait_for_ready Lib "hllapi.dll" (ByVal timeout As Integer) As Long
Declare Function hllapi_get_screen_at Lib "hllapi.dll" (ByVal row As Integer, ByVal col As Integer, ByVal text As String) As Long
Declare Function hllapi_enter Lib "hllapi.dll" () As Long
Declare Function hllapi_get_message_id Lib "hllapi.dll" () As Long
Declare Function hllapi_set_text_at Lib "hllapi.dll" (ByVal row As Integer, ByVal col As Integer, ByVal text As String) As Long
Declare Function hllapi_cmp_text_at Lib "hllapi.dll" (ByVal row As Integer, ByVal col As Integer, ByVal text As String) As Long
Declare Function hllapi_wait Lib "hllapi.dll" (ByVal timeout As Integer) As Long
Declare Function hllapi_pfkey Lib "hllapi.dll" (ByVal keycode As Integer) As Long
Declare Function hllapi_pakey Lib "hllapi.dll" (ByVal keycode As Integer) As Long