[futurebasic] Printing Error 25

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: GBeckman <GBeckman@...>
Date: Tue, 16 Dec 1997 01:48:54 EST
Feel like I just went back to Kindergarden.

I have not had trouble with an HP printer driver since '91 and suddenly my a
Beta App is getting error 25.  I am assuming this is -25 as that is Tried to
remove an open printer driver.  Indeed the error comes up as soon as as I call
Def Lprint.  This Beta print routine has been running smoothly since August.
No changes to the routine.  (I know...bad pointer somewhere)  The spooky part
is after two or three tries, the routine starts to work.  

Another question that came up was why when I deleted the two drivers from my
resource file.  When the program filled them, I got a message from Sam that
the Deskwriter 6.0 Driver was being tampered with.  Did just getting the size
or loading get Sam excited?

	The error is very machine specific and seems to be only happening with
Deskwriter 6.0 driver on old (the first) Deskwriters.  By machine specific, I
mean it happen on a 140 with 8 megs and not on a 640 with 16.  The app never
goes above 577 during the operation.  Tons of head room on both machines.   I
am updating my resources, dutifully, before calling DEF LPRINT. 

	I am doing some funny stuff I picked up from Staz in IB and so I include
these as questionabe...not that Staz didn't do it right but perhaps I did not
implement correctly when I adapted.  These two have been running as pasted
below since Jan '95

Thanks,

George


Here I get the loaded driver and save it for future App use. The trick here is
to save both landscape and portrait so the user need not switch.)

LOCAL
DIM sz
DIM resHndl&

LOCAL FN GetAndSaveDriver(WhichDriver)
  sz=FN GETHANDLESIZE(PRHANDLE)
  resHndl&=FN NEWHANDLE(sz)
  LONG IF resHndl&
    BLOCKMOVE [PRHANDLE],[resHndl&],sz
    FN pGreplaceRes(resHndl&,_"pREC",WhichDriver,"")
  END IF
END FN


Below I fetch the driver from my resource and use it.  I know I was supposed
to do more with errors in OSErr = FN HSETSTATE (resHndl&,hState) but am not
sure what is being checked for here.

LOCAL
DIM hstate
DIM OSErr
DIM rSize,pSize
DIM resHndl&,tempRec&

LOCAL FN GetTheDriver(WhichDriver)
  resHndl&=FN GETRESOURCE(_"pREC",WhichDriver)
  LONG IF resHndl&
    hState= FN HGETSTATE(resHndl&)
    OSErr= FN HNOPURGE(resHndl&)
    rSize=FN GETHANDLESIZE(resHndl&)
    pSize= FN GETHANDLESIZE(PRHANDLE)
    LONG IF rSize=pSize
      'its ok, so we replace it
      tempRec&=FN HANDTOHAND(PRHANDLE)
      BLOCKMOVE [resHndl&],[PRHANDLE],rSize
      OSErr = FN HSETSTATE (resHndl&,hState)
    END IF
  END IF
END FN