Results 1 to 3 of 3

Thread: How do I incorporate modules?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    How do I incorporate modules?

    Hi
    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:
    1. Option Explicit
    2. Declare Function Initreceivep6 Lib "socket.dll" Alias "receivep6" () As Long
    3. Declare Function Datatransfer Lib "socket.dll" Alias "transfer" (ByVal variable As Long) As Long
    4. Declare Function Setdata Lib "socket.dll" Alias "setdata" (ByVal variable As Long) As Long
    5. Declare Function Cleandata Lib "socket.dll" Alias "cleandata" (ByVal variable As Long) As Long
    6. Declare Sub Setip Lib "socket.dll" Alias "setip" (ByVal variable As String)

    vb form code
    VB Code:
    1. Option Explicit
    2. Dim Ipset
    3.  
    4. Private Sub Command10_Click()
    5. Command10.Visible = False
    6. Command18.Visible = True
    7. Label1.Visible = True
    8. Ipset = Setdata(&H40)
    9. Ipset = Datatransfer(Ipset)
    10. End Sub
    11.  
    12. Private Sub Command11_Click()
    13. Command11.Visible = False
    14. Command19.Visible = True
    15. Label2.Visible = True
    16. Ipset = Setdata(&H80)
    17. Ipset = Datatransfer(Ipset)
    18. End Sub
    19.  
    20. Private Sub Command18_Click()
    21. Command10.Visible = True
    22. Command18.Visible = False
    23. Label1.Visible = False
    24. Ipset = Cleandata(&HBF)
    25. Ipset = Datatransfer(Ipset)
    26. End Sub
    27.  
    28. Private Sub Command19_Click()
    29. Command11.Visible = True
    30. Command19.Visible = False
    31. Label2.Visible = False
    32. Ipset = Cleandata(&H7F)
    33. Ipset = Datatransfer(Ipset)
    34. End Sub
    35.  
    36. Private Sub Form_Load()
    37. Dim P6
    38. Setip "192.168.1.25"
    39.  
    40. P6 = Initreceivep6
    41.  
    42. If (P6 And &H40) Then
    43.     Command10.Visible = False
    44.     Command18.Visible = True
    45.     Setdata (&H40)
    46. 'value =64
    47.  
    48. Else
    49.     Command10.Visible = True
    50.     Command18.Visible = False
    51.     Cleandata (&HBF)
    52. End If
    53. If (P6 And &H80) Then
    54.     Command11.Visible = False
    55.     Command19.Visible = True
    56.     Setdata (&H80)
    57. Else
    58.     Command11.Visible = True
    59.     Command19.Visible = False
    60.     Cleandata (&H7F)
    61. End If
    62.  
    63. If (P6 And &HB40) Then
    64.     Label1.Visible = True
    65. Else
    66.     Label1.Visible = False
    67.     Cleandata (&HBF)
    68. End If
    69.  
    70. If (P6 And &HB80) Then
    71.     Label2.Visible = True
    72. Else
    73.     Label2.Visible = False
    74.     Cleandata (&H7F)
    75. End If
    76.  
    77. 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
    Last edited by si_the_geek; Dec 15th, 2005 at 06:44 PM. Reason: added VBCode tags

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: How do I incorporate modules?

    Can you explain the question again? DIdn't make much sense to me.

    And what is 'HA'?

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width