Please check my error in coding

Status
Not open for further replies.

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,601
dear helpers,

Hi i nit help some vb6 expert...anyone can check for me the coding below... it are the code set D1 goes high for Open button... im not sure whether D1 set for goes high or not for this button....please check and give solution for me? :|

Private Sub Open_Click(Index As Integer)

Value = 1
Out PortAddress, 2
Shape1(0).FillColor = vbWhite

End Sub
 

Hi Saathis,
the answer for this is "no" , it will not work, because you are accessing the parallel port of your hardware in windows platform, so at-first you have to have the access to that port before outing the data to that port , so you have to add a .dll(dynamic link library) file inside your application to access your parallel port , then using the function available inside the dll file you can use them directly in your code ,what you have already used .
The standard dll available for parallel port are "inpout16.dll" & "inpout32.dll",download them (check which one your pc requires).
Anyway , the procedure for adding dll and programming a parallel port is readily available in the below mentioned websites -
1.Parallelport Programming
2.**broken link removed**
3.Programming The Parallel Port In Visual Basic

Hope it is sufficient to solve your need,else feel free to contact me ,

Regards,
Saubhik
 
Hi Saubhik i 4got in4m as u say i have declare .dll in 1 module which contain coding below:

Private Declare Function Inp Lib "inpout32.dll" _

Alias "Inp32" (ByVal PortAddress As Integer) As Integer


Private Declare Sub Out Lib "inpout32.dll" _

Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)

ans also declared a variable to hold the value of the port address by type code

Dim PortAddress As String



Private Sub Form_Load ()

PortAddress = &H378


the coding where i type ask to check is inside the button.....coz i want set D1 goes high.... tat y i ask to check someone whether coding inside button is D1 goes high or not.... please check me again n answer again... tq saubhik..
 

Let me guess,
I assume you are using binary pattern - if yes then you have done-
Private Sub Open_Click(Index As Integer)

Value = 1
Out PortAddress, 2
Shape1(0).FillColor = vbWhite

End Sub

means you made 00000010 (2nd bit high) , check it is connected to your D1 or not.
else code is fine from implementation purse.
 
absolutely correct bro... im using binary string.... ya in te circuit it connect to D1 i check d.... so if i want make D2 goes to low te code is like tis: please check me again:

Private Sub Open_Click(Index As Integer)

Value = 0
Out PortAddress, 4
Shape1(0).FillColor = vbWhite

End Sub

---------- Post added at 01:17 ---------- Previous post was at 01:17 ----------

absolutely correct bro... im using binary string.... ya in te circuit it connect to D1 i check d.... so if i want make D2 goes to low te code is like tis: please check me again:

Private Sub Open_Click(Index As Integer)

Value = 0
Out PortAddress, 4
Shape1(0).FillColor = vbWhite

End Sub
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…