Page 1 of 1

oPrn:SetCopies() bug ?

Posted: Tue Nov 20, 2007 2:20 pm
by Davide
Hello guys,

I've just noticed that oPrn:SetCopies(nCopies) works ok if the printed document is longer than 1 page, otherwise I always obtain a single copy.
I tried with different printers and machines, with or without PREVIEW (If PREVIEW a 2+ pages document and print them all I obtain n copies, while if I print only 1 page on a multipage preview I obtain only a single printed page)

Any clues ?

TIA
Davide
FWH 7.09

Posted: Wed Nov 21, 2007 1:06 am
by Davide
I've just tested FWH27 (xH) and found it behaved the same.

I've also found this function in printdc.c, but cannot see why it should work only for multipage documents.

Any idea ?

Thanks,
Davide

Code: Select all

#ifdef __HARBOUR__
   CLIPPER PRNSETCOPIES( PARAMS ) // ( nCopies )  --> lSuccess
#else
   CLIPPER PRNSETCOPI( PARAMS ) // ES( nCopies )  --> lSuccess
#endif
{
   LPDEVMODE lpDevMode;

   PrinterInit();

   lpDevMode = (LPDEVMODE) GlobalLock( pd.hDevMode );

   lpDevMode->dmCopies = _parni( 1 );

   if( PCOUNT() == 2 )  // Compatibility with previous syntax!
      lpDevMode->dmCopies = _parni( 2 );

   GlobalUnlock( pd.hDevMode );

   _retl( TRUE );
}

Posted: Wed Nov 21, 2007 1:52 am
by Davide
Ok, I've found out another printer (Brother) which works correctly, so it seems the problem is in the driver of the "HP LaserJet 5/5M PS" and the "HP LaserJet 4100" (maybe they both use the same driver).

Does that happened to anyone else before ?