I have two programs running on the same computer that use the ActiveHome X10 scripting library. One is a program that is always running on the computer to handle the events when an X10 event is detected written in Visual Basic. The other is a WebPage written with Visual Web Developer with CodeBehind in Visual Basic.
When I run only the Visual Basic program, all is fine. It receives X10 commands (sent by remote controls or motion detectors) and executes fine.
When I run the webpage (VB program still running) and have it send X10 commands, the VB program sees the X10 commands and responds. But when I exit the Webpage, the VB program stops seeing X10 events from the remote. Exiting the webpage or stopping and starting the VB program doesn't correct this. I have to reboot the computer.
Here is the code I use in both the VB program and Webpage to use ActiveHome X10:
Both use:
Dim WithEvents ActiveHomeObj As ActiveHome
...
The Webpage sends X10 commands by:
ActiveHomeObj = CreateObject("X10.ActiveHome")
ActiveHomeObj.SendAction("sendplc", "a10 on")
ActiveHomeObj = Nothing
The VB program that handles the events has:
Sub ActiveHome_RecvAction(ByVal bszRecv As Object _
, ByVal v1 As Object _
, ByVal v2 As Object _
, ByVal v3 As Object _
, ByVal v4 As Object _
, ByVal v5 As Object _
, ByVal vRes As Object) Handles ActiveHomeObj.RecvAction
(code to handle events)
end sub
Any suggestions?
I should have noted that I have included the reference for ActiveHome in the both programs.
Also, this problem does not happen when I run the webpage with Visual Web Developer debugging using the local host...only when I run the webpage in the normal way with a browser.