Printing directly to LPT/COM

June 12th, 2008 - 05:01 am ET by Tony | Report spam
I have this in VB6

Open "lpt1" For Output As #1
Print #1, "abc"
Close (1)

How to do this in VB.NET? I am trying with FileOpen but it doesnt work. Can
anyone help?

Thanks
email Follow the discussionReplies 5 repliesReplies Make a reply

Similar topics

Replies

#1 Dick Grier
June 12th, 2008 - 11:51 am ET | Report spam
Hi,

There are a couple of ways.

You can download IONet.dll from my homepage (a device driver wrapper that
allows direct access to physical LPT ports, but not virtual ones, such as
USB), or: http://support.microsoft.com/kb/322090/en-us

Dick

Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Replies Reply to this message
#2 MikeD
June 12th, 2008 - 08:03 pm ET | Report spam
"Tony" wrote in message
news:g2qonq$jlt$
I have this in VB6

Open "lpt1" For Output As #1
Print #1, "abc"
Close (1)

How to do this in VB.NET? I am trying with FileOpen but it doesnt work.
Can anyone help?




You're best off asking this in a dotnet newsgroup.

Mike
Microsoft MVP Visual Basic
Replies Reply to this message
#3 MikeD
June 12th, 2008 - 08:20 pm ET | Report spam
"MikeD" wrote in message
news:

"Tony" wrote in message
news:g2qonq$jlt$
I have this in VB6

Open "lpt1" For Output As #1
Print #1, "abc"
Close (1)

How to do this in VB.NET? I am trying with FileOpen but it doesnt work.
Can anyone help?




You're best off asking this in a dotnet newsgroup.




Duh! I now see you did crosspost to a dotnet newsgroup. For the record, the
microsoft.public.vb.* newsgroups are for VB6 and earlier. In the future,
please don't include them in crossposts for dotnet-related questions.
Thanks!

Mike
Microsoft MVP Visual Basic
Replies Reply to this message
#4 steve907
June 13th, 2008 - 09:05 am ET | Report spam
On Jun 12, 7:20 pm, "MikeD" wrote:
"MikeD" wrote in message

news:



> "Tony" wrote in message
>news:g2qonq$jlt$
>>I have this in VB6

>> Open "lpt1" For Output As #1
>> Print #1, "abc"
>> Close (1)

>> How to do this in VB.NET? I am trying with FileOpen but it doesnt work.
>> Can anyone help?

> You're best off asking this in a dotnet newsgroup.

Duh! I now see you did crosspost to a dotnet newsgroup. For the record, the
microsoft.public.vb.* newsgroups are for VB6 and earlier. In the future,
please don't include them in crossposts for dotnet-related questions.
Thanks!

Mike
Microsoft MVP Visual Basic



Now I'm confused. Isn't this a dotnet newsgroup?
Replies Reply to this message
#5 Jim Mack
June 13th, 2008 - 09:30 am ET | Report spam
steve907 wrote:
On Jun 12, 7:20 pm, "MikeD" wrote:
"MikeD" wrote in message

news:



"Tony" wrote in message
news:g2qonq$jlt$
I have this in VB6





Open "lpt1" For Output As #1
Print #1, "abc"
Close (1)





How to do this in VB.NET? I am trying with FileOpen but it
doesnt work. Can anyone help?





You're best off asking this in a dotnet newsgroup.



Duh! I now see you did crosspost to a dotnet newsgroup. For the
record, the microsoft.public.vb.* newsgroups are for VB6 and
earlier. In the future, please don't include them in crossposts
for dotnet-related questions. Thanks!

Mike
Microsoft MVP Visual Basic



Now I'm confused. Isn't this a dotnet newsgroup?



There is no "this", there's a "these" -- two incompatible groups.

The OP cross-posted to two NGs. Groups with "dotnet" in their names
are indeed for dotnet. Groups with just ".public.vb." in their names
are not. Hence the confusion.

Just to clarify: microsoft.public.vb.winapi is NOT a dotnet group.

Jim
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search