Click here to Skip to main content
12,819,140 members (27,715 online)

Visual Basic

 
AnswerRe: Decoding USBSTOR Registry Entry in VB Pin
Alan N18-Jan-13 2:21
memberAlan N18-Jan-13 2:21 
GeneralRe: Decoding USBSTOR Registry Entry in VB Pin
SantLou4018-Jan-13 2:47
memberSantLou4018-Jan-13 2:47 
GeneralRe: Decoding USBSTOR Registry Entry in VB Pin
Alan N18-Jan-13 5:05
memberAlan N18-Jan-13 5:05 
JokeRe: Decoding USBSTOR Registry Entry in VB Pin
Jeffnogueira22-Jan-13 5:31
memberJeffnogueira22-Jan-13 5:31 
QuestionVB.NET ReportViewer too many Page Breaks rendered Pin
SantLou4017-Jan-13 4:39
memberSantLou4017-Jan-13 4:39 
AnswerRe: VB.NET ReportViewer too many Page Breaks rendered Pin
ChandraRam17-Jan-13 21:04
memberChandraRam17-Jan-13 21:04 
GeneralRe: VB.NET ReportViewer too many Page Breaks rendered Pin
SantLou4018-Jan-13 2:39
memberSantLou4018-Jan-13 2:39 
Questioncontrol 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian15-Jan-13 21:10
memberLord Christian15-Jan-13 21: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 21:42
memberBernhard Hiller15-Jan-13 21:42 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian17-Jan-13 8:15
memberLord Christian17-Jan-13 8:15 
AnswerRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan15-Jan-13 23:59
mvpRichard MacCutchan15-Jan-13 23:59 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian17-Jan-13 7:56
memberLord Christian17-Jan-13 7:56 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan17-Jan-13 8:10
mvpRichard MacCutchan17-Jan-13 8:10 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian17-Jan-13 8:33
memberLord Christian17-Jan-13 8:33 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan17-Jan-13 23:51
mvpRichard MacCutchan17-Jan-13 23:51 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian18-Jan-13 5:58
memberLord Christian18-Jan-13 5:58 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Richard MacCutchan18-Jan-13 6:10
mvpRichard MacCutchan18-Jan-13 6:10 
GeneralRe: control 5 appliances using pc's parallel port[vb.net 2010] Pin
Lord Christian20-Jan-13 19:55
memberLord Christian20-Jan-13 19:55 
QuestionBuilding COM Components Using MATLAB - Part I Pin
SergentX13-Jan-13 7:35
memberSergentX13-Jan-13 7:35 
AnswerRe: Building COM Components Using MATLAB - Part I Pin
Eddy Vluggen14-Jan-13 4:13
mvpEddy Vluggen14-Jan-13 4:13 
GeneralMessage Removed Pin
SergentX14-Jan-13 9:20
memberSergentX14-Jan-13 9:20 
AnswerRe: Building COM Components Using MATLAB - Part I Pin
Eddy Vluggen14-Jan-13 10:59
mvpEddy Vluggen14-Jan-13 10:59 
QuestionDebug user control in VB6.0 ? Pin
Member 24584678-Jan-13 23:38
memberMember 24584678-Jan-13 23:38 
AnswerRe: Debug user control in VB6.0 ? Pin
ChandraRam17-Jan-13 21:08
memberChandraRam17-Jan-13 21:08 
QuestionHow make DOWNLOADER in VB 2010 ? Pin
radoslaw1238-Jan-13 8:21
memberradoslaw1238-Jan-13 8: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.


Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 22 Mar 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid