FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Conversion 1303 to 1402 : PRINT ... cModel
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM

Conversion 1303 to 1402 : PRINT ... cModel

Posted: Wed Apr 23, 2014 08:54 AM

Hello ,

Making the conversion from a big FWH aplication from FWH1303 to FWH1402 , i have problems withy the command :

PRINT oPrn NAME cTitle TO aPrinters[nPrint] // Checked : PDFCREATOR , printer is defined in windows
DBG oPrn

oPrn Shows as expected cModel (PDFCreator) and a value for hDc

BUT THE OUTPUT : DEFAULT WINDOWS PRINTER

What has changed ?

Frank

test
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM

Re: Conversion 1303 to 1402 : PRINT ... cModel

Posted: Wed Apr 23, 2014 12:31 PM
Hello ,

After some testing i found :

Working :

Code (fw): Select all Collapse
   PRINTER oPrn TO "PDFCreator"//FROM USER // PREVIEW
      PAGE
            oPrn:Say( 10, 1, "ok" )
      ENDPAGE      
   ENDPRINTER


Not working (printing to windows default) :

Code (fw): Select all Collapse
   PRINTER oPrn TO "PDFCreator"//FROM USER // PREVIEW
      [b]oPrn:SetPage(9)  //A4   !!!!!!!!!!!!!!!!!!!!!!!!!!!![/b]
      PAGE
            oPrn:Say( 10, 1, "ok" )
      ENDPAGE      
   ENDPRINTER


In printer.prg : // Defines for the oPrn:SetPage(nPage) method (The printer MUST support it)

But also oPrn:Setcopies() gives the same result , probably all the methods which rebuild the printobject

Code (fw): Select all Collapse
METHOD Rebuild() CLASS TPrinter

   # ifdef FRANKDEMONT
   local cModel := ::cModel   
   # endif

.......
......
/* following modifications after fw1308 are commented out subject to further review 2014-02-15
   // eg. SetLandScape(), etc. stopped working with this modification
   if ::hDC == 0
      ::hDC       = GetPrintDefault( GetActiveWindow() )
      ::lStarted  = .F.
      ::lModified = .T.
   endif
*/

   // Following 5 lines upto "endif" are restored from FW1308 2014-02-15
   if ::hDC != 0
      DeleteDC( ::hDC )
      # ifdef FRANKDEMONT
        ::hDC = PrinterDcFromName( , cModel, )
      # else 
        ::hDC := GetPrintDefault( GetActiveWindow() )
      # endif
      //::hDC := GetPrintDefault( GetActiveWindow() )   // <== ???????????????????????????????????????????????????????
      ::lStarted   := .F.
      ::lModified  := .T.
   endif

   if ::hDC != 0
      if ! ::lMeta
         ::hDcOut = ::hDC
      endif
   endif

return nil




Frank
test
Posts: 130
Joined: Sat Oct 08, 2005 09:38 PM

Re: Conversion 1303 to 1402 : PRINT ... cModel

Posted: Thu Apr 24, 2014 11:58 PM

I confirm the problem.
Because of this I didn't switch to 1402. Still I am using 1309.

Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7

Continue the discussion