Results 1 to 6 of 6

Thread: Printing

  1. #1

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024

    Printing

    Can someone give me an example of how to print a string to the printer? I seem to be having problems doing this.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I've never done it, but I think printing to a printer is the same as using the streams in C++ (Files, Console io, etc) but that you have to map it to LPT1 or something.. I try to look something up for ya!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Great thanks I will try the stream. I was trying to use OpenPrinter, WritePrinter, etc and was failing.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  5. #5

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Ok neither worked. I have XP an the printer is local but the stream isn't working. Nothing happens and it locks on the close so it must not be getting opened
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  6. #6
    Junior Member
    Join Date
    Dec 2002
    Location
    in a little closet
    Posts
    30
    have you tried this
    --------------
    include <stdio.h>
    void main()
    {
    FILE *printer;
    printer = fopen("LPT1,"w");
    fprintf(printer,"Hello World");
    }

    ----------------

    or can have it go to disk and then print it out,
    remember to have disk in a:
    ----------------
    include <stdio.h>
    void main()
    {
    FILE *todisk;
    todisk = fopen("a:\myfile.txt,"w");
    fprintf(todisk,"Hello World");
    }
    -------------
    All Help Very Much Appreciated

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width