Board index » delphi » Accessing the parallel port in XP

Accessing the parallel port in XP


2006-11-28 01:48:57 PM
delphi269
Sorry but this is technical. BTW, CodeGear is an interesting name, looks
like the IDE business will now be focusing on automotive security!
Anyway, some programmers may remember in the good old days of V3 and
Win95/98, you could access the parallel port by using a simple function
called outportb (b stands for byte), inportb, outpw and inpw (w=word). Then
Windows 2000 and XP came along and direct access to ports became disabled
since this allowed a flaky program to crash the operating system if the
wrong memory area was selected. Sounds reasonable ... except if you have any
old hardware devices like EPROM programmers which need the parallel port to
work.
The website below is a program which enables the parallel port for certain
selected programs. There is even a Delphi example.
www.direct-io.com/
The question is, is it possible to have a Dephi/CBuilder program enable
direct access to the parallel port while it is running and then disable it
when finished. Starting the DirectIO program and having to ship it with each
product seems cumbersome.
 
 

Re:Accessing the parallel port in XP

"JoeAverage" <XXXX@XXXXX.COM>writes
Quote
Sorry but this is technical. BTW, CodeGear is an interesting name, looks
like the IDE business will now be focusing on automotive security!

Anyway, some programmers may remember in the good old days of V3 and
Win95/98, you could access the parallel port by using a simple function
called outportb (b stands for byte), inportb, outpw and inpw (w=word).
Then Windows 2000 and XP came along and direct access to ports became
disabled since this allowed a flaky program to crash the operating system
if the wrong memory area was selected. Sounds reasonable ... except if you
have any old hardware devices like EPROM programmers which need the
parallel port to work.

The website below is a program which enables the parallel port for certain
selected programs. There is even a Delphi example.
www.direct-io.com/

The question is, is it possible to have a Dephi/CBuilder program enable
direct access to the parallel port while it is running and then disable it
when finished. Starting the DirectIO program and having to ship it with
each product seems cumbersome.

I have long since used TVicHW32 for this purpose. It has proven very
efficient and reliable: www.entechtaiwan.com/dev/hw32/index.shtm
regards Sven
 

Re:Accessing the parallel port in XP

JoeAverage writes:
Quote
The question is, is it possible to have a Dephi/CBuilder program enable
direct access to the parallel port while it is running and then disable it
when finished. Starting the DirectIO program and having to ship it with each
product seems cumbersome.
Thatīs trivial to be implemented. The code here works for Delphi too:
wiki.lazarus.freepascal.org/Hardware_Access.dll_for_Windows
Should be simple to convert it to c++ to work with CBuilder.
 

Re:Accessing the parallel port in XP

JoeAverage writes:
Quote
Sorry but this is technical. BTW, CodeGear is an interesting name,
looks like the IDE business will now be focusing on automotive
security!

Anyway, some programmers may remember in the good old days of V3 and
Win95/98, you could access the parallel port by using a simple
function called outportb (b stands for byte), inportb, outpw and inpw
(w=word). Then Windows 2000 and XP came along and direct access to
ports became disabled since this allowed a flaky program to crash the
operating system if the wrong memory area was selected. Sounds
reasonable ... except if you have any old hardware devices like EPROM
programmers which need the parallel port to work.

The website below is a program which enables the parallel port for
certain selected programs. There is even a Delphi example.
www.direct-io.com/

The question is, is it possible to have a Dephi/CBuilder program
enable direct access to the parallel port while it is running and
then disable it when finished. Starting the DirectIO program and
having to ship it with each product seems cumbersome.
There's a component that lets you access the parallel port just fine in
Delphi / C++Builder. It comes with a driver -- I think that is the trick.
--
Best regards,
Jonathan Neve
_______________
CopyTiger - advanced database replicator for Interbase/Firebird!
Web : www.microtec.fr/copycat/ct
_______________________________________
CopyCat - database replication components for Delphi/C++Builder!
Web : www.microtec.fr/copycat/cc
 

Re:Accessing the parallel port in XP

Isn't it possible to use CreateFile with "LPT1" etc and use ReadFile and
WriteFile just like when working with COM ports?
"JoeAverage" <XXXX@XXXXX.COM>skrev i meddelandet
Quote
Sorry but this is technical. BTW, CodeGear is an interesting name, looks
like the IDE business will now be focusing on automotive security!

Anyway, some programmers may remember in the good old days of V3 and
Win95/98, you could access the parallel port by using a simple function
called outportb (b stands for byte), inportb, outpw and inpw (w=word).
Then Windows 2000 and XP came along and direct access to ports became
disabled since this allowed a flaky program to crash the operating system
if the wrong memory area was selected. Sounds reasonable ... except if you
have any old hardware devices like EPROM programmers which need the
parallel port to work.

The website below is a program which enables the parallel port for certain
selected programs. There is even a Delphi example.
www.direct-io.com/

The question is, is it possible to have a Dephi/CBuilder program enable
direct access to the parallel port while it is running and then disable it
when finished. Starting the DirectIO program and having to ship it with
each product seems cumbersome.



 

Re:Accessing the parallel port in XP

Thanks for the replies, I have saved them and will look at them later. It
sounds like all is not lost on the parallel port. It is much easier to use
than a USB port - has anyone managed to get their head around the USB. The
600 page USB manual cured my insomnia problem.
Magnus, using readilfe and write file will only allow you to use the
parallel port normally. For peripheral devices, it is nice to use the
control lines.for other purposes like selecting the high or low 8 address
bits.
"Magnus Flysj? <magnus@nospam>writes
Quote
Isn't it possible to use CreateFile with "LPT1" etc and use ReadFile and
WriteFile just like when working with COM ports?

"JoeAverage" <XXXX@XXXXX.COM>skrev i meddelandet
news:XXXX@XXXXX.COM...
>Sorry but this is technical. BTW, CodeGear is an interesting name, looks
>like the IDE business will now be focusing on automotive security!
>
>Anyway, some programmers may remember in the good old days of V3 and
>Win95/98, you could access the parallel port by using a simple function
>called outportb (b stands for byte), inportb, outpw and inpw (w=word).
>Then Windows 2000 and XP came along and direct access to ports became
>disabled since this allowed a flaky program to crash the operating system
>if the wrong memory area was selected. Sounds reasonable ... except if
>you have any old hardware devices like EPROM programmers which need the
>parallel port to work.
>
>The website below is a program which enables the parallel port for
>certain selected programs. There is even a Delphi example.
>www.direct-io.com/
>
>The question is, is it possible to have a Dephi/CBuilder program enable
>direct access to the parallel port while it is running and then disable
>it when finished. Starting the DirectIO program and having to ship it
>with each product seems cumbersome.
>
>
>