Hi Brian,
Thanks so much for getting back to me.
Here's the text of an email I sent to Tony Northrop:
Hi Tony,
First of all, thanks for all the cool topics
you've presented. I am a big fan of your Home Hacking Projects book. Through
your book I was able to create my own Perl based light controller (it gradually
turns the lights on in my room, to help me get up at 4:30 to go to
work.)
I recently came across your Controlling
lights article and am very excited to rebuild the application (with a lot
more features and a cool "front end") in Visual Basic (to which I am a complete
but enthusiastic newbie.) However, I am finding myself completely stymied with
the references aspect of the project.
Using the Solution Explorer I added the CraigsCreations.com.x10
dll as well as the SerialPort dll. However, upon cutting and pasting the x10
code I was immediately hit with an error indication by Intellisense. The
error offered to fix the problem by switching the X10CM11aController object with the xm17 controller. When I did that I got
the same error, but this time the IDE offered to switch me back to the xm11a
controller. I got past this by going to the references tab on the
properties page and selecting the check boxes that said anything
about CraigsCreations.
Now I get a null exception error
when it hits the New x10lamp code. Looking at the error details it seems that
there is a problem with the SerialPort reference. I don't know if this helps,
but SerialPort shows up in the Object Browser when 'view containers' is set, but
not when 'view namespaces' is set.
Here's my code so
far:
Imports CraigsCreations.com.X10
Imports System.IO
Imports
System.IO.IsolatedStorage
Public Class X10Control
'current CM11 controller is on
com1, bedroom light is housecode A unit 1
Dim x10
As IX10Controller =
New
X10CM11aController(HouseCode.A, "COM1")
' Replace the unit codes in the
following two lines with unit codes
' that you assign to your
lamps
Dim
BedroomLight As X10Lamp =
New X10Lamp(X10, 1) ' this is where it seems to hang up with the null exception error
Private
Sub
btnON_Click(ByVal sender
As System.Object,
ByVal e As System.EventArgs) Handles btnON.Click
End
Sub
End Class
I
really hope there's something very obvious I'm doing wrong. In any case any help
would be greatly appreciated!
Thank
you,
Arlin
Vanderbilt
__________________________________
So, my hunch is that there is a namespace issue with the SerialPort dll which apparently is called by the X10Lamp class (method? I'm still learning the lingo.) By the way, The visual basic solution that Northrop wrote can be downloaded
here. I copied the dll's from there. The original dll's were originally available from
craigscreations.com., but the link seems to be broken now. Any way, the SerialPort dll was written by 'Craig' to work with the x10 controls. I don't know if I could (or how, I would) substitute the standard SerialPort classes.
Well, I hope I'm just doing something obviously wrong. And in any case, any help is really appreciated.
Thanks,
Arlin