Announcement

Collapse
No announcement yet.

Idiotic problem with ASPX page...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Idiotic problem with ASPX page...

    I'm in the middle of creating a plugin. I've made the public scripting functions, and they work great using scripts. This is completely OK within a script:
    Code:
    hs.Plugin("Domation").CreateDevice("Child 1 Green", "A3", 1, 2, True)

    However, if I place the exact same line in my ASPX page for the plugin, I get an "Object not set to an instance of an Object" error which does not make sense.

    If I in the aspx page for example do:
    Code:
    Response.Write(hs.Plugin("Domation").Version)
    ... it prints out the version number just like it should!

    And if I remove a parameter from the function call, like this:
    Code:
    hs.Plugin("Domation").CreateDevice("Child 1 Green", "A3", 1, 2)
    ... I get an "Overload resolution failed because no accessible 'CreateDevice' accepts this number of arguments" like I should. So the aspx page DOES find the function!


    I'm completely stuck! I seriously don't know what's going on.

    What am I missing?
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

    #2
    How about: hs.Plugin("Domation").CreateDevice("Child 1 Green", "A3", 1, 2, True)
    Jon

    Comment


      #3
      I don't know if I can see a difference between your line and my (first) line, or am I going blind? (It wouldn't be the first time)
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment


        #4
        Sorry, I misread your post - you are not going blind!
        Jon

        Comment


          #5
          OK, I'm closer but still rather far away.

          I can't reference the HS object in my CreateDevice sub! I've simplied it down to this:

          Code:
              Public Sub CreateDevice(ByVal p_name As String, ByVal p_DeviceCode As String, ByVal p_DomationRef As Integer, ByVal p_DomationChannel As Integer, ByVal p_IsRGB As Boolean)
                  Try
                      hs.WriteLog("Test", "Entering CreateDevice in Domation")
                  Catch ex As Exception
                      Throw New Exception("Domation, CreateDevice: " & ex.Message)
                  End Try
              End Sub
          ... and even that gives me an "Object not set to an instance of an object" error!

          Right above is the New() sub, which also uses the HS object, but that works fine!
          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
          Running on Windows 10 (64) virtualized
          on ESXi (Fujitsu Primergy TX150 S8).
          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

          Comment


            #6
            Try it without the parentheses.
            hs.Plugin("Domation").CreateDevice "Child 1 Green", "A3", 1, 2, True

            Comment


              #7
              That's not it. ASPX is .NET and therefore you must use paranthesis.
              HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
              Running on Windows 10 (64) virtualized
              on ESXi (Fujitsu Primergy TX150 S8).
              WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

              Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

              Comment


                #8
                Just a stab in the dark but have to tried renaming your CreateDevice sub.

                Paul..

                Comment


                  #9
                  Originally posted by sooty View Post
                  Just a stab in the dark but have to tried renaming your CreateDevice sub.
                  Yes, I renamed it to "Testing123" to be sure that it wasn't a naming conflict. But nothing changed.
                  HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                  Running on Windows 10 (64) virtualized
                  on ESXi (Fujitsu Primergy TX150 S8).
                  WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                  Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                  Comment


                    #10
                    Originally posted by Moskus View Post
                    That's not it. ASPX is .NET and therefore you must use paranthesis.
                    Would it hurt you to try it?

                    Comment


                      #11
                      Originally posted by knarfm View Post
                      Would it hurt you to try it?
                      Yes. VS doesn't "allow" it.
                      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                      Running on Windows 10 (64) virtualized
                      on ESXi (Fujitsu Primergy TX150 S8).
                      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                      Comment


                        #12
                        I thought the HS object was late bound.
                        If CreateDevice is a Function with a return value then declare a variable of the proper return type and assign it to your function call.

                        Comment


                          #13
                          Originally posted by knarfm View Post
                          I thought the HS object was late bound.
                          If CreateDevice is a Function with a return value then declare a variable of the proper return type and assign it to your function call.
                          Yes, it can be. However, changing it from Object to Scheduler.hsapplication doesn't matter.

                          CreateFunction is a sub that uses the HS object to create a new device.
                          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                          Running on Windows 10 (64) virtualized
                          on ESXi (Fujitsu Primergy TX150 S8).
                          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                          Comment

                          Working...
                          X