can u help me to solve my program please!!!!!1:icon_cry:
i don't have any idea againt.......

Dani AI

Generated

Short answer up front: a passive “USB-to-DB25” printer cable will not give a laptop the real parallel-port registers that VB6/InpOut-style code needs. Those cables speak the USB printer class to the OS and do not expose the legacy I/O addresses or ECP/EPP timing that old LPT code expects. ()

Clarifying the existing posts: as pointed out, the AaronCake-style tutorials are good references for programming an actual LPT port; and ’s InpOut32 example is the usual VB6 approach for direct port I/O. InpOut32 (and similar low-level drivers) only work when there is a real parallel port or a driver that maps a device into I/O-space; they will not “force” a USB printer adapter to behave like an LPT. (highrez.co.uk)

Practical alternatives (pick one that matches the hardware and timing needs):

  • Add a real LPT to the laptop (CardBus/ExpressCard/docking-station or a dedicated parallel-port card) — these present as real EPP/ECP LPTs and can work with existing code. (manualpdf.in)
  • Use a USB device designed for GPIO/bit‑bang (FTDI chips such as FT232H/FT232R offer bit‑bang or MPSSE modes) and talk to it with its D2XX API or a small protocol. This preserves deterministic pin control without pretending to be an ISA LPT. (ftdichip.com)
  • Replace the parallel hack with a tiny MCU (Arduino / similar) and communicate over a virtual COM or HID interface from VB6 (MSComm or simple serial routines). The MCU toggles the DB‑25 signals or provides a safer, modern interface. (store.arduino.cc)

If the target device absolutely requires ECP/EPP timing (some programmers, dongles or legacy hardware do), choose a real LPT adapter/card; otherwise the MCU or FTDI approach is usually faster to implement and more reliable on modern laptops.

Recommended Answers

All 5 Replies

have a look at
http://www.aaroncake.net/electronics/vblpt.htm

It looks a bit complicated at first, but it isn't really. try it in small steps and it will work

thanks, but my problem can we use parallel port in laptop cause i just have USB port!....... :(

hang on,

Are you trying to programme the USB port or the parallel port?

If you have a parallel port then you can program to it. but if you don't have a physical parallel port then no you can't program to it

hang on,

Are you trying to programme the USB port or the parallel port?

If you have a parallel port then you can program to it. but if you don't have a physical parallel port then no you can't program to it

in my laptop don't have parallel port........
but i wanna buy port USB to DB25...... can i do my program or not???
if can are that's need driver or not????
:(

code goes here


frm1

Option Explicit
Dim Value As Integer
Dim PortAddress As Integer
Dim Timer As Integer
Dim label As Integer
Dim x As Integer
Dim b As Integer
Dim textbox As String


Private Sub Check1_Click()
If Check1.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H1
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HFE
Out PortAddress, Value
End If
End Sub

Private Sub Check2_Click()
If Check2.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H2
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HFD
Out PortAddress, Value
End If
End Sub

Private Sub Check3_Click()
If Check3.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H4
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HFB
Out PortAddress, Value
End If
End Sub

Private Sub Check4_Click()
If Check4.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H8
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HF7
Out PortAddress, Value
End If
End Sub


Private Sub Check5_Click()
If Check5.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &O255
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &O0
Out PortAddress, Value
End If
End Sub

Private Sub Check6_Click()
If Check6.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H40
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HBF
Out PortAddress, Value
End If
End Sub

Private Sub Check7_Click()
If Check7.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H20
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HDF
Out PortAddress, Value
End If
End Sub

Private Sub Check8_Click()
If Check8.Value = 1 Then
Value = Inp(PortAddress)
Value = Value Or &H10
Out PortAddress, Value
Else
Value = Inp(PortAddress)
Value = Value And &HEF
Out PortAddress, Value
End If
End Sub

Private Sub Command1_Click()
Value = &HFF
PortAddress = &H378
Out PortAddress, Value
Check1.Value = 1
Check2.Value = 1
Check3.Value = 1
Check4.Value = 1
Check5.Value = 1
Check6.Value = 1
Check7.Value = 1
Check8.Value = 1
End Sub

Private Sub Command2_Click()
Value = 0
PortAddress = &H378
Out PortAddress, Value
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Check6.Value = 0
Check7.Value = 0
Check8.Value = 0
End Sub

module1

'Inp and Out declarations for port I/O using inpout32.dll.

Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" _
(ByVal PortAddress As Integer) _
As Integer

Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" _
(ByVal PortAddress As Integer, _
ByVal Value As Integer)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.