Jump to content

Similarities


Recommended Posts

Ok, our AS400 emulators can use a VB6 style interface and allow for direct manipulation using VB6 and certian DLL files. I'm not here to ask about DLLCall() just yet, but I'm wondering if the COM functions work in similar context to the VB6 style of coding.

Example, after the references are set, we interface with the emulators via:

CODE
'--------PCommC Info---------

Global PS(1 To 6) As AutPS

Global IA(1 To 6) As AutOIA

Global PSa As AutPS

Global PSb As AutPS

Global PSc As AutPS

Global PSd As AutPS

Global PSe As AutPS

Global PSf As AutPS

Global IAa As AutOIA

Global IAb As AutOIA

Global IAc As AutOIA

Global IAd As AutOIA

Global IAe As AutOIA

Global IAf As AutOIA

Global i01 As Integer

Global i02 As Integer

Global SessionList As New AutConnList

Global TotalInfo

Function PcommC()

On Error Resume Next

DoEvents

Dim ConLetter(1 To 6)

ConLetter(1) = "A"

ConLetter(2) = "B"

ConLetter(3) = "C"

ConLetter(4) = "D"

ConLetter(5) = "E"

ConLetter(6) = "F"

For i01 = 1 To 6

Set IA(i01) = CreateObject("PCOMM.autECLOIA")

Set PS(i01) = CreateObject("PCOMM.autECLPS")

Next i01

Set SessionList = New AutConnList

For i02 = 1 To SessionList.Count

PS(i02).SetConnectionByName (ConLetter(i02))

IA(i02).SetConnectionByName (ConLetter(i02))

Next i02

Set IAa = CreateObject("PCOMM.autECLOIA")

Set PSa = CreateObject("PCOMM.autECLPS")

Set IAb = CreateObject("PCOMM.autECLOIA")

Set PSb = CreateObject("PCOMM.autECLPS")

Set IAc = CreateObject("PCOMM.autECLOIA")

Set PSc = CreateObject("PCOMM.autECLPS")

Set IAd = CreateObject("PCOMM.autECLOIA")

Set PSd = CreateObject("PCOMM.autECLPS")

Set IAe = CreateObject("PCOMM.autECLOIA")

Set PSe = CreateObject("PCOMM.autECLPS")

Set IAf = CreateObject("PCOMM.autECLOIA")

Set PSf = CreateObject("PCOMM.autECLPS")

IAa.SetConnectionByName ("A")

PSa.SetConnectionByName ("A")

IAb.SetConnectionByName ("B")

PSb.SetConnectionByName ("B")

IAc.SetConnectionByName ("C")

PSc.SetConnectionByName ("C")

IAd.SetConnectionByName ("D")

PSd.SetConnectionByName ("D")

IAe.SetConnectionByName ("E")

PSe.SetConnectionByName ("E")

IAf.SetConnectionByName ("F")

PSf.SetConnectionByName ("F")

End Function

If we wanted to interface with the "C" emulator, we'd create a line saying:

PS(3).<command> "<whatever>"

Example:

PS(3).GetText([3], [2], [20]) = X
              Row, Col, Len

From what I've seen of COM, it funtions in a similar fasion, no? Since these emulators have a built in VB interface, I could dig into it with AutoIt, right?

I would use

$oPCOMM.autECLPS.GetText = ???

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Ok, our AS400 emulators can use a VB6 style interface and allow for direct manipulation using VB6 and certian DLL files.  I'm not here to ask about DLLCall() just yet, but I'm wondering if the COM functions work in similar context to the VB6 style of coding.

...

From what I've seen of COM, it funtions in a similar fasion, no?  Since these emulators have a built in VB interface, I could dig into it with AutoIt, right?

I would use

$oPCOMM.autECLPS.GetText = ???

<{POST_SNAPBACK}>

Hello Blue_Drache,

I am not familiar with AS/400 emulators, but I can point you at some limitations in AutoIt3:

1. Your code example uses arrays containing objects. AutoIt3 accepts these kind of arrays also, but you can't do direct COM calls using the array elements.

So a line like: PS(3).<command> "<whatever>" would have to be split into:

$objectPS = PS(3)

$objectPS.<command>("<whatever>")

2. In your code example I saw also line with: Set SessionList = New AutConnList

These kind of things are also not possible in AutoIt3 script. You have to search for the declaration of 'AutConnList' and find a different way to retrieve a SessionList.

3. The VB-syntax has to be rewritten into AutoIt3 syntax. Like array elements in brackets [] instead of parentheses (), removing the 'Set' keywords, etc. etc.

I hope this helps you a bit in the right direction.

Regards,

-Sven

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...