PRINTER CLASS

PRINTER CLASS

Postby Otto » Sat Jan 06, 2007 3:03 pm

To Antonio,

As I sometimes have problems with a white sheet in preview I thought of changing printer.prg. This occurs if the program breaks and the wmf-file is not destroyed by the calling program. You have to cancel wowoexec and then delete the temp-wmf file in windows/temp or - as a user - restart the system.


I inserted:

aDirTMP := directory(::cDir+"\*.wmf", "D")

and changed
AAdd(::aMeta,::cDir+"\T"+ALLTRIM(STR(len(aDirTMP)+1))+Padl(::nPage,4,"0")+".wmf")

So every wmf-file gets a new filename.

Could someone of the advanced Fivewinners check this code, please.

Thanks in advance
Otto


METHOD _StartPage() CLASS TPrinter

LOCAL lSetFixed
LOCAL aDirTMP := {}

If ::hDC = 0
Return NIL
endif

lSetFixed := Set(_SET_FIXED,.F.)

if !::lMeta .AND. !::lStarted
::lStarted := .T.
StartDoc( ::hDC, ::cDocument )
endif

::nPage++

aDirTMP := directory(::cDir+"\*.wmf", "D")


if ::lMeta
AAdd(::aMeta,::cDir+"\T"+ALLTRIM(STR(len(aDirTMP)+1))+Padl(::nPage,4,"0")+".wmf")
::hDCOut := CreateMetaFile(Atail(::aMeta))
else
StartPage(::hDC)
endif

Set(_SET_FIXED,lSetFixed )

Return NIL
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Re: PRINTER CLASS

Postby Enrico Maria Giordano » Sat Jan 06, 2007 3:58 pm

Otto wrote:You have to cancel wowoexec


WowExec is for 16 bit only. Did you post in the wrong forum?

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

Postby Otto » Sat Jan 06, 2007 4:17 pm

Yes, you are right. It should be for the FW forum.

I had a look into FWH code and I saw that FWH does it with
cTempFile(). So the problem does not exist anymore.

AAdd( ::aMeta, ::cDir + cTempFile( "\", "wmf" ) )

It is time for me to say goodby to clipper - as I still use 1.9 (rock solid ).

Otto
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Sat Jan 06, 2007 7:41 pm

Otto,

Yes, you should move to 32 bits using FWH
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests