My code keeps Jamming the Printer - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

My code keeps Jamming the Printer

Greetings
I'm working on a (plain text)MDI text editor & I can't get the print function to work, It just jams the printer. The printer(HP, InkJet type) is attached to another machine on my network(all the other software is "happy" with it, Its just my code. I've tried to fine a code sample that will work, But everything I've found is either MFC, also jams it or both. I'm NOT using MFC(I never use MFC). I'd post the code I'm working with but, at this point it's so badly commented I can't even follow it :)

Does anyone have an idea where I chould(or should) attack this? Or have a (nonMFC) code sample?

I'm using MSVC++6 & the rest of the prog works on Win95-XP


Thank You
Stoic Joker

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : Greetings
    : I'm working on a (plain text)MDI text editor & I can't get the print function to work, It just jams the printer. The printer(HP, InkJet type) is attached to another machine on my network(all the other software is "happy" with it, Its just my code. I've tried to fine a code sample that will work, But everything I've found is either MFC, also jams it or both. I'm NOT using MFC(I never use MFC). I'd post the code I'm working with but, at this point it's so badly commented I can't even follow it :)
    :
    : Does anyone have an idea where I chould(or should) attack this? Or have a (nonMFC) code sample?
    :
    : I'm using MSVC++6 & the rest of the prog works on Win95-XP
    :
    :
    : Thank You
    : Stoic Joker
    :

    Check if you follow the correct pritning technology:
    [code]
    StartDoc();
    for (int i=0; i<nPages; i++) {
    StartPage ();
    // Setup the printer DC here: fonts, colors, etc.
    // your code for page printing...
    EndPage ();
    }
    EndDoc();
    [/code]


  • Stoic JokerStoic Joker Posts: 84Member
    Greetings
    Um...


    [code]
    StartDoc(); // <-I Think I'm Okay Here

    for (int i=0; i<nPages; i++) { /* Using( or trying to)PD_USEDEVMODECOPIESANDCOLLATE to avoid this part(bad idea? */

    StartPage (); /* This has to be working or the printer wouldn't jam, yes? */

    // Setup the printer DC here: fonts, colors, etc.
    // your code for page printing...

    /* perhaps these(above) two are where I'm screwing up, All I'm trying to do is plain(black & white) text. The MSDN Sample I found "How to Print a bitmap" has not been helpfull :)*/

    EndPage ();
    }
    EndDoc();
    [/code]

    I completely Lost on this. I've spent two days on the MSDN & can't get this to work.


    Thank You
    Stoic Joker

Sign In or Register to comment.