473,403 Members | 2,366 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,403 software developers and data experts.

Send raw data to a printer with VB .NET 2005?

Does anyone have a working example of sending raw data to a printer with
VB.NET 2005? I've tried this example
http://msdn.microsoft.com/library/de...cyhardware.asp
and got an error when trying to run it. The example listed above is close to
what I want to do, except I would like to send the data that is created on
the fly to the printer without using temporary files.

Thanks for your help,
Pete
Feb 13 '06 #1
4 8933
pete wrote:
Does anyone have a working example of sending raw data to a printer with
VB.NET 2005? I've tried this example
http://msdn.microsoft.com/library/de...cyhardware.asp
and got an error when trying to run it. The example listed above is close to
what I want to do, except I would like to send the data that is created on
the fly to the printer without using temporary files.

Thanks for your help,
Pete


I used that example to get me started. What error did you get?
Feb 13 '06 #2
Look at this link:

http://support.microsoft.com/kb/322090/en-us

Regards

Ernesto
pete wrote:
Does anyone have a working example of sending raw data to a printer with
VB.NET 2005? I've tried this example
http://msdn.microsoft.com/library/de...cyhardware.asp
and got an error when trying to run it. The example listed above is close to
what I want to do, except I would like to send the data that is created on
the fly to the printer without using temporary files.

Thanks for your help,
Pete


Feb 13 '06 #3
Chris wrote:
pete wrote:
Does anyone have a working example of sending raw data to a printer with
VB.NET 2005? I've tried this example
http://msdn.microsoft.com/library/de...cyhardware.asp
and got an error when trying to run it. The example listed above is close to
what I want to do, except I would like to send the data that is created on
the fly to the printer without using temporary files.

Thanks for your help,
Pete


I used that example to get me started. What error did you get?


I get the following error when I trun to run the program

Error 1 Handles clause requires a WithEvents variable defined in the
containing type or one of its base types.

It's complaining about this line

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

Feb 14 '06 #4
When I tried the example that you pointed out to me I get the following
errors

Warning 1 Variable 'di' is passed by reference before it has been
assigned a value. A null reference exception could result at runtime.
Make sure the structure or all the reference members are initialized
before use
Warning 2 Function 'SendStringToPrinter' doesn't return a value on all
code paths. A null reference exception could occur at run time when the
result is used.
Warning 3 Access of shared member, constant member, enum member or
nested type through an instance; qualifying expression will not be
evaluated.
Warning 4 Access of shared member, constant member, enum member or
nested type through an instance; qualifying expression will not be
evaluated.
I noticed that the article is for Dot Net 1.0 and Dot Net 1.1 but VB
2005 using Dot Net 2

Feb 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kurien Baker Fenn | last post by:
How to send data from an ASP form to a visual basic form? Please help
2
by: SWJust | last post by:
Hi... is it possible to send data from a socket to at physical address (MAC) on f.x another PC or Router ??? I have a IP header with information about another client, and this cannot be altered,...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
5
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying...
0
by: realgoggi | last post by:
Hello, I have a label printer connected to LPT1 on the server where IIS and the ASPX/C# code is running. From the web application I need to send data to the printer. Preferably directly,...
2
by: ajaxcoder | last post by:
Hi In my project i had a login form and i am trying to send the username and password to the server for authentication using xmlHttpRequest. Hence i am using POST request but i am unable to send...
3
by: romcab | last post by:
Hi guys, Just want to ask how can I send data serially? I have here a sample code but I use sockets and tcpclient class but I'm wondering how to do it using serial cable.Any idea? Private...
5
sid0404
by: sid0404 | last post by:
Hi I am new to the visualstudio.net I am trying to develop an application which requires me to send data to a HTML webpage - http://patft.uspto.gov/netahtml/PTO/search-bool.html and the user...
2
by: mohanaabi | last post by:
In c # vs.net 2005 (windows application) is it possible to send data from one application to another application. Can the content in textbox of one application can b sent to textbox of another...
1
by: Abdulrahman Ahm | last post by:
Hello, How can I use jquery's post method to send a variable to my servlet, I am using a java web application, so far I have something like this $(document).ready(function() { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.