FWH 8.12 Printer problem

FWH 8.12 Printer problem

Postby betoncu » Thu Jan 01, 2009 4:53 pm

After I have upgrade fivewin to 8.12
Code: Select all  Expand view
      aPrnAry:=aGetPrinters()
      cPrinter:=aPrnAry[2]
      PRINT oPrn DOC cDoc TO cPrinter

does not work because it cannot find the printer.

I have checked the printer.prg and I have realised that the lines below commented
Code: Select all  Expand view
      cPrinter := GetProfString( "windows", "device" , "" )
      WriteProfString( "windows", "device", cModel )
      SysRefresh()
      PrinterInit()
      ::hDC := GetPrintDefault( GetActiveWindow() )
      SysRefresh()
      WriteProfString( "windows", "device", cPrinter  )

instead of them the lines below added
Code: Select all  Expand view
      PrinterInit()
      DeleteDC( ::hDC )
      ::hDC = PrinterDCfromName( cModel )

But the print system cannot find the printer to print.

Regards,
Birol BETONCU
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: FWH 8.12 Printer problem

Postby Antonio Linares » Thu Jan 01, 2009 6:19 pm

Birol,

What Windows version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 8.12 Printer problem

Postby betoncu » Thu Jan 01, 2009 7:11 pm

Antonio,
I am using Win XP SP3

Regards
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: FWH 8.12 Printer problem

Postby Enrico Maria Giordano » Fri Jan 02, 2009 12:47 pm

Works fine here with the same Windows version. Maybe a printer driver issue?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH 8.12 Printer problem

Postby Antonio Linares » Fri Jan 02, 2009 1:30 pm

Birol,

Please try to replace the lines that you point in your first post with the commented ones, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 8.12 Printer problem

Postby betoncu » Fri Jan 02, 2009 2:12 pm

Antonio,
It works fine after I removed the new lines and inserted the old ones.

Regards,
Birol Betoncu
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: FWH 8.12 Printer problem

Postby betoncu » Fri Jan 02, 2009 3:13 pm

I have done a self contained examle.
Please try this. The program quits without showing the preview screen.
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()
local oPrn, cPrinter, cDoc:='test', aPrnAry:=aGetPrinters()
   cPrinter:=aPrnAry[2]
   MsgInfo("Selected printer "+cPrinter)
//   PRINT oPrn DOC cDoc PREVIEW              // If I use this line it works fine
   PRINT oPrn DOC cDoc TO cPrinter PREVIEW    // This line does not work
      PAGE
         oPrn:Say( 20, 20, "This is a test" )
      ENDPAGE
   ENDPRINT
return nil


Regards,
Birol Betoncu
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: FWH 8.12 Printer problem

Postby Antonio Linares » Mon Jan 05, 2009 11:57 am

Birol,

> MsgInfo("Selected printer "+cPrinter)

What is the name shown for cPrinter ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 8.12 Printer problem

Postby Richard Chidiak » Mon Jan 05, 2009 2:32 pm

Antonio

Printing to a specified printer has changed in fwh versions

Back to fwh 8.08 , you needed to select the printer and model ,i mean the model is included after the name separated with a comma . This was working ok, i use it in my pos system

Fron fwh 8.10 this was not working anymore, only the printer name has to be set...

this is my printer select function , the commented line is what has to be used now

I am still using fwh 8.08

HTH

Richard

FUNCTION GETIMPRI(ADEVICES)
*----------------------------------------
LOCAl cAllEntries, cEntry, I, cName, cPrn, cPort, J
cAllEntries := STRTRAN( GetProfString( "Devices" ), Chr( 0 ), CRLF )
FOR I:= 1 TO MlCount( cAllEntries )
cName := MemoLine( cAllEntries,,I)
cEntry := GetProfString( "Devices",cName,"")
J := 2
WHILE ! EMPTY(cPort := StrToken(cEntry,J++,","))
// AADD(aDevices,TRIM(cName))
AADD(aDevices,TRIM(cName) + "," + CENTRY)
ENDDO
NEXT
RETURN aDevices
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: FWH 8.12 Printer problem

Postby betoncu » Mon Jan 05, 2009 4:11 pm

MsgInfo returns the correct printer name i.e "HP LaserJet 5L"
I have tried the GETDEFAULTPRINTER() function as shown below. It does not work also.

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()
local oPrn, cPrinter, cDoc:='test'
   cPrinter := GETDEFAULTPRINTER()
   MsgInfo(cPrinter)
   PRINT oPrn DOC cDoc TO cPrinter PREVIEW
      PAGE
         oPrn:Say( 20, 20, "This is a test" )
      ENDPAGE
   ENDPRINT
return nil

Regards,
Birol BETONCU
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: FWH 8.12 Printer problem

Postby Antonio Linares » Mon Jan 05, 2009 8:32 pm

Birol,

Your first example is working fine here on Vista Ultimate 32 and using a shared lan printer (Canon).

Tested with FWH 8.12.
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()
local oPrn, cPrinter, cDoc:='test', aPrnAry:=aGetPrinters()
   cPrinter:=aPrnAry[2]
   MsgInfo("Selected printer "+cPrinter)
   PRINT oPrn DOC cDoc TO cPrinter PREVIEW    // Working fine with Vista 32
      PAGE
         oPrn:Say( 20, 20, "This is a test" )
      ENDPAGE
   ENDPRINT
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 8.12 Printer problem

Postby Antonio Linares » Mon Jan 05, 2009 8:35 pm

Dear Enrico,

Could you please test Birol's first example on Windows XP ? thanks

We only use Windows XP here from vmware (virtual). All our machines use Vista and some already testing Windows 7 pre-beta.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 8.12 Printer problem

Postby Enrico Maria Giordano » Mon Jan 05, 2009 9:18 pm

It doesn't work. Please check this possible fix: in function PrintBegin() replace

Code: Select all  Expand view
   cDevice := aPrn[ nScan ] + "," + cText


with

Code: Select all  Expand view
   cDevice := aPrn[ nScan ]// + "," + cText


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH 8.12 Printer problem

Postby PeterHarmes » Thu Jan 15, 2009 3:01 pm

Enrico Maria Giordano wrote:It doesn't work. Please check this possible fix: in function PrintBegin() replace

Code: Select all  Expand view
   cDevice := aPrn[ nScan ] + "," + cText


with

Code: Select all  Expand view
   cDevice := aPrn[ nScan ]// + "," + cText


EMG


I'm having the same problem and can confirm that the above seems to fix the problem - i'm assuming this will be in as standard for the next release?
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: FWH 8.12 Printer problem

Postby Antonio Linares » Thu Jan 15, 2009 3:19 pm

Pete,

yes, we have modifed it as Enrico suggested and it will be included in next FWH 9.01 :-)

Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests