473,388 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Printing directly to LPT/COM

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
5 5191
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

"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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc Champagne | last post by:
Hi folks, I wish to print on pre-printed continuous forms on a dot matrix printer. My initial intent was to access to printer directly (in raw mode, somehow) in order to send whatever is...
9
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
2
by: ACaunter | last post by:
Hi all, i was wondering if there was a way to directly print a document to the user's printer, without having to download it first... I needed something like a button, and when the user clicks the...
5
by: Tom | last post by:
I am converting an old application that was printing directly to a specialized printer device (i.e. a special label printer). It was doing this by opening a file with the file path of 'LPT1:' and...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
0
by: aleemkhan | last post by:
I am using SQL Server 2005 Local Reports for a web based project. The problem is that the ASP.NET default Web Report Viewer does not have print facility for Local Reports. When the report is...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
1
by: mehdi | last post by:
Hi, Consider a printing scenario where I have to draw the entire page on a 827x1169 (.01 inch) size. Thereafter, the entire bitmap has to be resized to fill a given Bounds rectangle (keeping the...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.