Printing to Laser vs Inkjet

This is my first post, so please guide me if I have cjosen the wrong place.

I am printing from my C++ application written under Visual C++ 6.0, and I can print fine to Laser printers such as LaserJet II or LaserJet 4400, but if I direct the print to a DeskJet printer,  the document doesn't print and the printer status box always seems to dhow 48 bytes printed out of whatever the document size is. The code I'm using to start printing is.....

==============================================

    vertpos = 0;
    dinfo.lpszDocName ="Membership Card";
    dinfo.lpszOutput = NULL;
    dinfo.lpszDatatype = NULL;
    dinfo.fwType = 0;
    dinfo.cbSize = sizeof(DOCINFO);

    CString printer_name;
    CPrintDialog pdlg(TRUE,PD_ALLPAGES|PD_RETURNDC,NULL);
    if(pdlg.DoModal()==IDCANCEL)
        return;

    printer_name = pdlg.GetDeviceName();

    hdc=pdlg.GetPrinterDC();
    pdc = CDC::FromHandle(hdc);

    cHeightPels = GetDeviceCaps(hdc, VERTRES);

// prepare doc
    pdc->StartDoc((LPDOCINFO)&dinfo);

    pdc->StartPage();

    tcf.CreatePointFont(100,"Courier New",pdc);


    pdc->SelectObject(&tcf);
    tcf.GetLogFont(&lfnt);

    iRowPos = iTopMargin;
    iColPos = iLeftMargin;

//    iRowPos = 200;

    iTextHeight = abs(lfnt.lfHeight) + 10;
    iCharWidth =  abs(lfnt.lfWidth) +10;

================================

Any help very much appreciated.

Alyn



Answer this question

Printing to Laser vs Inkjet