By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,199 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,199 IT Pros & Developers. It's quick & easy.

Printing directly to LPT/COM

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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.
Jun 27 '08 #2

P: n/a

"Tony" <to*****@gmail.comwrote in message
news:g2**********@sunce.iskon.hr...
>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
Jun 27 '08 #3

P: n/a

"MikeD" <no****@nowhere.eduwrote in message
news:eX**************@TK2MSFTNGP04.phx.gbl...
>
"Tony" <to*****@gmail.comwrote in message
news:g2**********@sunce.iskon.hr...
>>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
Jun 27 '08 #4

P: n/a
On Jun 12, 7:20 pm, "MikeD" <nob...@nowhere.eduwrote:
"MikeD" <nob...@nowhere.eduwrote in message

news:eX**************@TK2MSFTNGP04.phx.gbl...
"Tony" <tony...@gmail.comwrote in message
news:g2**********@sunce.iskon.hr...
>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?
Jun 27 '08 #5

P: n/a
steve907 wrote:
On Jun 12, 7:20 pm, "MikeD" <nob...@nowhere.eduwrote:
>"MikeD" <nob...@nowhere.eduwrote in message

news:eX**************@TK2MSFTNGP04.phx.gbl...
>>"Tony" <tony...@gmail.comwrote in message
news:g2**********@sunce.iskon.hr...
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

Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.