I have a vb.net 2003 app that connects with homeseer. I am having trouble getting my app to properly communicate. I have even created a new test app that is basically identical to the demo code in the help for activex .net interface example. I created a blank project and added references to classes, homeseer2 and scheduler dlls. Basics of the code are as follows...
Imports System
Imports System.Configuration
Imports System.Runtime.Remoting
Imports System.Threading
Imports classes
Imports scheduler
Public Class Form1
Inherits System.Windows.Forms.Form
Public hs As Scheduler.hsapplication
...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
hs = New Scheduler.hsapplication
Button2.Enabled = True
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Dim dv As DeviceClass
'dv = hs.GetDevice(1)
TextBox1.Text = hs.DeviceCount
End Sub
...
Everything seems to connect (no errors on clicking button 1) but all calls I have tried via button 2 seem to return nulls or 0. The above returns 0 as it is now. I don't know if it is not opening my mdb or what. I have tried running hs 2 as a service, as an app and not at all before trying my app . As far as Homeseer, either as a service or as an app it automatically opens my mdb file which has a number of devices and events. I would think even if it was opening some other mdb it would have some devices. I have tried with both 1997 and 2003 versions.
Any ideas?
Imports System
Imports System.Configuration
Imports System.Runtime.Remoting
Imports System.Threading
Imports classes
Imports scheduler
Public Class Form1
Inherits System.Windows.Forms.Form
Public hs As Scheduler.hsapplication
...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
hs = New Scheduler.hsapplication
Button2.Enabled = True
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Dim dv As DeviceClass
'dv = hs.GetDevice(1)
TextBox1.Text = hs.DeviceCount
End Sub
...
Everything seems to connect (no errors on clicking button 1) but all calls I have tried via button 2 seem to return nulls or 0. The above returns 0 as it is now. I don't know if it is not opening my mdb or what. I have tried running hs 2 as a service, as an app and not at all before trying my app . As far as Homeseer, either as a service or as an app it automatically opens my mdb file which has a number of devices and events. I would think even if it was opening some other mdb it would have some devices. I have tried with both 1997 and 2003 versions.
Any ideas?
Comment