How do I incorporate modules?
Hi :wave:
I have detailed below a simple vb program which is part of a vb.exe . I wish to use in a vb script which I can use in some HA software.
My question is how can I query the dll without the module?
module code
VB Code:
Option Explicit
Declare Function Initreceivep6 Lib "socket.dll" Alias "receivep6" () As Long
Declare Function Datatransfer Lib "socket.dll" Alias "transfer" (ByVal variable As Long) As Long
Declare Function Setdata Lib "socket.dll" Alias "setdata" (ByVal variable As Long) As Long
Declare Function Cleandata Lib "socket.dll" Alias "cleandata" (ByVal variable As Long) As Long
Declare Sub Setip Lib "socket.dll" Alias "setip" (ByVal variable As String)
vb form code
VB Code:
Option Explicit
Dim Ipset
Private Sub Command10_Click()
Command10.Visible = False
Command18.Visible = True
Label1.Visible = True
Ipset = Setdata(&H40)
Ipset = Datatransfer(Ipset)
End Sub
Private Sub Command11_Click()
Command11.Visible = False
Command19.Visible = True
Label2.Visible = True
Ipset = Setdata(&H80)
Ipset = Datatransfer(Ipset)
End Sub
Private Sub Command18_Click()
Command10.Visible = True
Command18.Visible = False
Label1.Visible = False
Ipset = Cleandata(&HBF)
Ipset = Datatransfer(Ipset)
End Sub
Private Sub Command19_Click()
Command11.Visible = True
Command19.Visible = False
Label2.Visible = False
Ipset = Cleandata(&H7F)
Ipset = Datatransfer(Ipset)
End Sub
Private Sub Form_Load()
Dim P6
Setip "192.168.1.25"
P6 = Initreceivep6
If (P6 And &H40) Then
Command10.Visible = False
Command18.Visible = True
Setdata (&H40)
'value =64
Else
Command10.Visible = True
Command18.Visible = False
Cleandata (&HBF)
End If
If (P6 And &H80) Then
Command11.Visible = False
Command19.Visible = True
Setdata (&H80)
Else
Command11.Visible = True
Command19.Visible = False
Cleandata (&H7F)
End If
If (P6 And &HB40) Then
Label1.Visible = True
Else
Label1.Visible = False
Cleandata (&HBF)
End If
If (P6 And &HB80) Then
Label2.Visible = True
Else
Label2.Visible = False
Cleandata (&H7F)
End If
End Sub
I wish to remove need for graphics and in the vb script use
SetPropertyValue() fed to a device in the program.
ie If (P6 And &HB80) Then
SetPropertyValue(X)
Any ideas anyone :confused:
Re: How do I incorporate modules?
Can you explain the question again? DIdn't make much sense to me.
And what is 'HA'?
Re: How do I incorporate modules?
Hi Mendhak
HA is Home automation software(sorry should of explained better)
Let me try and explain what I am trying to do.
The piece of software I use is called Housebot and it has the ability to use a devices which one is namely a script file.
The code mentioned so far is some I have played with and changed to my own uses from a sdk that came with a piece of hardware(ip controller).This basically has 2 methods of communication. It sits on the lan with an IP address and indeed its own webserver. So I can access through webpage with port No 8080 for eg.Then log in(mandatory) and view status of the equipments pots/connections.In the above case it is 2 no power controlling ports for lights.
The other option is using a VB or C++ program to access the dll(socket dll) which came with machines software sdk
My goal is to query the dll and then display the ouptut in Housebot via a script.
I can take of the values the query produces in Housebot.ie if response =&H80(in hex) I can create a task that says switch seven is off (or whatever).
So
This led me down the path of converting the vb exe into script.
Hence question re dll and module etc.
Am I missing something or is the only way to deal with my problem?
Am I making the whole thing too complicated?
Am i correct in thinking I cannot acces the dll directly from vbscript?