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

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.