Announcement

Collapse
No announcement yet.

CapiGetControl compile error with Linux

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

    CapiGetControl compile error with Linux

    I have a function that uses Capi and works great with my Windows-based system but won't compile on my HomeTroller SEL Pro under Linux.

    Sub Main(ByVal parm As Object)

    Dim arrCC() As CAPIControl = Nothing
    arrCC = hs.CAPIGetControl(16)
    End Sub

    When I run this in a Homeseer Event I get an error:

    Compiling script /usr/local/HomeSeer/scripts/Conversion Phase 2/FindError2.vb: Value of type 'Object' cannot be converted to 'HomeSeerAPI.CAPI/CAPIControl[]'.

    If I comment out the CAPI call it compiles clean.

    I have found that mono requires strong typing where Microsoft may be forgiving. Is there a problem with CAPIGetControl returning the correctly typed object? Or am I missing a declaration?

    Any advice would be appreciated.

    #2
    Workaround found

    I was able to get this working by assigning the return array to a generic type Object:

    Dim ArrCC as Object
    arrCC = hs.CAPIGetControl(16)

    I'm able to use real types for most of my HS3 objects, but apparently not this one.

    Comment

    Working...
    X