Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to the parallel port

Status
Not open for further replies.

jfradley

Programmer
Jul 7, 2003
14
US
Does anybody have an example of writing to the parallel port with any dot net langauge for Win XP Pro?

Thanks,
Joe
 
As far as i know there is no .NET library class that wraps Serial Port communications. Leaving you with a choice of using Platform Invocation Services or finding someone elses control that does it for you.

Basically you use the CreateFile() Win32 API and then use the IntPtr return value to open a .NET System.IO.FileStream.

Here is a link to a MSDN article that discusses doing just that:


I think you might find third party controls that handle this for you. There might even be one or two free ones found on GotDotNet.com

-pete
 
Thanks for the info. But that class doesn't apply yo the parallel port. I had to download third party driver, 'DLPORTIO.DLL'.
 
>> But that class doesn't apply yo the parallel port

I don't know what class you mean. Given the example if you use the CreateFile() API with the value "LPT1" it opens a handle to the Parallel Port using the default driver configured for the port.


-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top