Click here to Skip to main content
15,889,216 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Decoding USBSTOR Registry Entry in VB Pin
Alan N18-Jan-13 1:21
Alan N18-Jan-13 1:21 
GeneralRe: Decoding USBSTOR Registry Entry in VB Pin
SantLou4018-Jan-13 1:47
SantLou4018-Jan-13 1:47 
GeneralRe: Decoding USBSTOR Registry Entry in VB Pin
Alan N18-Jan-13 4:05
Alan N18-Jan-13 4:05 
JokeRe: Decoding USBSTOR Registry Entry in VB Pin
Jeffnogueira22-Jan-13 4:31
Jeffnogueira22-Jan-13 4:31 
QuestionVB.NET ReportViewer too many Page Breaks rendered Pin
SantLou4017-Jan-13 3:39
SantLou4017-Jan-13 3:39 
AnswerRe: VB.NET ReportViewer too many Page Breaks rendered Pin
ChandraRam17-Jan-13 20:04
ChandraRam17-Jan-13 20:04 
GeneralRe: VB.NET ReportViewer too many Page Breaks rendered Pin
SantLou4018-Jan-13 1:39
SantLou4018-Jan-13 1:39 
Questioncontrol 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian15-Jan-13 20:10
Lord Christian15-Jan-13 20:10 
my pc's operating system
windows 7 ultimate 32 bit
-------------------------


i am working on a project that will control 5 devices through pc parallel port/printer port.
when i run the program it will first appear a loginform
then when i enter.
it always returns that the port doesnt exist.
even though i have the port it cant detect it.. i dont know what is wrong with my code.

--------------------------------------------------------
Dim FILE_NAME As String = "LPT1"

If System.IO.File.Exists(FILE_NAME) Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write("hi")
objWriter.Close()
MsgBox("ok")
Else
MsgBox("port does not exist")
End If
------------------------------------------------------
then after the login the next form is homepage. there you'll see the switch buttons that will turn on and off a device. when i clicked any of this buttons an error will prompt. its say that object reference not set to an instance of an object

NullReferenceException was unhandled.

Private Sub btn_app1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app1.Click
If btn_app1.Text = "ON" Then
btn_app1.Text = "OFF"
btn_app1.BackColor = Color.Red
io(0)
Else
btn_app1.Text = "ON"
btn_app1.BackColor = Color.Green
io(1)
End If
End Sub

Private Sub btn_app2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app2.Click
If btn_app2.Text = "ON" Then
btn_app2.Text = "OFF"
btn_app2.BackColor = Color.Red
io(0)
Else
btn_app2.Text = "ON"
btn_app2.BackColor = Color.Green
io(2)
End If
End Sub

Private Sub btn_app3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app3.Click
If btn_app3.Text = "ON" Then
btn_app3.Text = "OFF"
btn_app3.BackColor = Color.Red
io(0)
Else
btn_app3.Text = "ON"
btn_app3.BackColor = Color.Green
io(4)
End If
End Sub

Private Sub btn_app4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app4.Click
If btn_app4.Text = "ON" Then
btn_app4.Text = "OFF"
btn_app4.BackColor = Color.Red
io(0)
Else
btn_app4.Text = "ON"
btn_app4.BackColor = Color.Green
io(8)
End If
End Sub

Private Sub btn_app5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app5.Click
If btn_app5.Text = "ON" Then
btn_app5.Text = "OFF"
btn_app5.BackColor = Color.Red
io(0)
Else
btn_app5.Text = "ON"
btn_app5.BackColor = Color.Green
io(16)
End If
End Sub

Private Sub io(ByVal bit As Integer)
val = axHwinterface1.InPort(888)
axHwinterface1.OutPort(888, CShort(val Or bit))
End Sub

--------------------------------------------------------
please help me im new in this.. Cry | :(( i need your help guys.. thank you in advance..
every response is very much appreciated

if you want to see my whole project you can Download it here

http://www.mediafire.com/?1zvx1ty736r2nnb
AnswerRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Bernhard Hiller15-Jan-13 20:42
Bernhard Hiller15-Jan-13 20:42 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian17-Jan-13 7:15
Lord Christian17-Jan-13 7:15 
AnswerRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan15-Jan-13 22:59
mveRichard MacCutchan15-Jan-13 22:59 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian17-Jan-13 6:56
Lord Christian17-Jan-13 6:56 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan17-Jan-13 7:10
mveRichard MacCutchan17-Jan-13 7:10 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian17-Jan-13 7:33
Lord Christian17-Jan-13 7:33 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan17-Jan-13 22:51
mveRichard MacCutchan17-Jan-13 22:51 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian18-Jan-13 4:58
Lord Christian18-Jan-13 4:58 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan18-Jan-13 5:10
mveRichard MacCutchan18-Jan-13 5:10 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian20-Jan-13 18:55
Lord Christian20-Jan-13 18:55 
QuestionBuilding COM Components Using MATLAB - Part I Pin
SergentX13-Jan-13 6:35
SergentX13-Jan-13 6:35 
AnswerRe: Building COM Components Using MATLAB - Part I Pin
Eddy Vluggen14-Jan-13 3:13
professionalEddy Vluggen14-Jan-13 3:13 
GeneralMessage Closed Pin
14-Jan-13 8:20
SergentX14-Jan-13 8:20 
AnswerRe: Building COM Components Using MATLAB - Part I Pin
Eddy Vluggen14-Jan-13 9:59
professionalEddy Vluggen14-Jan-13 9:59 
QuestionDebug user control in VB6.0 ? Pin
Member 24584678-Jan-13 22:38
Member 24584678-Jan-13 22:38 
AnswerRe: Debug user control in VB6.0 ? Pin
ChandraRam17-Jan-13 20:08
ChandraRam17-Jan-13 20:08 
QuestionHow make DOWNLOADER in VB 2010 ? Pin
radoslaw1238-Jan-13 7:21
radoslaw1238-Jan-13 7:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.