3 Replies - 14115 Views - Last Post: 29 April 2008 - 04:44 AM Rate Topic: -----

#1 mauripelto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-April 08

Printing from Console application in C#

Posted 26 April 2008 - 10:45 AM

I used to use C a long time ago. Now I'm trying to re-learn it via C# 2008Express and C on lcc-win32.

Am I suddenly dense??! I can't find how to output calculation results to the printer!

THE QUESTION: How, (in C or C#) do I write code that will send my computation results to the printer?

(I'm on WindowsXP, BTW)

Mauri
Is This A Good Question/Topic? 0
  • +

Replies To: Printing from Console application in C#

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4399
  • View blog
  • Posts: 12,255
  • Joined: 18-April 07

Re: Printing from Console application in C#

Posted 26 April 2008 - 11:17 AM

Psychocoder made a nice tutorial covering printing in C#. While there is only one spot where he uses a GUI element (a textbox) it can easily be integrated right into the console application for printing.

So check it out and we can certainly help with any problems you have with your code getting it to work. (Then you can just show us your code).

Printing in C# - By PsychoCoder

Enjoy! :)
Was This Post Helpful? 0
  • +
  • -

#3 mauripelto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-April 08

Re: Printing from Console application in C#

Posted 28 April 2008 - 11:33 AM

View PostMartyr2, on 26 Apr, 2008 - 11:17 AM, said:

Psychocoder made a nice tutorial covering printing in C#. While there is only one spot where he uses a GUI element (a textbox) it can easily be integrated right into the console application for printing.

So check it out and we can certainly help with any problems you have with your code getting it to work. (Then you can just show us your code).

Printing in C# - By PsychoCoder

Enjoy! :)


Thanks Martyr2 and PsychoCoder! I'm working on it and will let you know if I have a problem. Mauri

Later....OK. I tacked your code to my "Hello World" code and added PCPrint("Something"); I get about 5 repetitions of the following error when I Build it:

Error 1 The type or namespace name 'Drawing' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\TextHello\Program.cs 6 14 TextHello

This post has been edited by mauripelto: 28 April 2008 - 12:31 PM

Was This Post Helpful? 0
  • +
  • -

#4 zakary  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 27
  • View blog
  • Posts: 427
  • Joined: 15-February 05

Re: Printing from Console application in C#

Posted 29 April 2008 - 04:44 AM

you need to right click on your "References" folder and click add references then COM then System.Drawing.dll
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1