Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fatal error using the function PRTINFO(nPrinterSetting [, cP
Message
From
03/01/2003 09:42:49
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Fatal error using the function PRTINFO(nPrinterSetting [, cP
Miscellaneous
Thread ID:
00737655
Message ID:
00737655
Views:
123
Fatal error using the function
PRTINFO(nPrinterSetting [, cPrinterName])

The error is not constant, but occurs quite often.

In the versions VFP 6.0, VFP 7.0 , VFP 8.0 beta

Fatal error: Exception code=C0000005 @ 11.06.2002 03:34 PM. Error log file: C:\Program Files\Common Files\Microsoft Shared\VFP\vfp7rerr.log
Called from - ReportFormPrompt.setprnsize line 35 {c:\PF\pf_frm\ReportFormPrompt.sct}

*** procedure SetPrnSize

Local cPaperNumbers, cPaperNames, nPaperTypes, Counter
Local cPrnName, cPrnPort,lprninfo,lprnpaper

With This
If .prnCount = 0
.cboPaper.Enabled = .F.
Return
Endif
.cboPaper.Enabled = .T.

cPrnName = .PrnArray[.cboPrnName.LISTINDEX, 1]
cPrnPort = .PrnArray[.cboPrnName.LISTINDEX, 2]

*------ get then allocate string sizes required for Paper information ------
nPaperTypes = DeviceCapabilities(cPrnName, cPrnPort, DC_PAPERS, 0, 0)
cPaperNumbers = Space((nPaperTypes*2))
cPaperNames = Space((nPaperTypes*64))

*------ retrieve and proccess Paper information ------
= DeviceCapabilities(cPrnName, cPrnPort, DC_PAPERS, @cPaperNumbers, 0)
= DeviceCapabilities(cPrnName, cPrnPort, DC_PAPERNAMES, @cPaperNames, 0)

Dimension .prnPaper[nPaperTypes, 2]
.cboPaper.Clear

For Counter = 1 To nPaperTypes
.prnPaper[Counter, 2] = (Asc(Substr(cPaperNumbers, (Counter*2), 1))*256) + ;
(Asc(Substr(cPaperNumbers, (Counter*2) - 1, 1)))
.prnPaper[Counter, 1] = Substr(cPaperNames, ((Counter - 1)*64) + 1, 64)
If Left(.prnPaper[Counter, 1], 1) = "\"
.cboPaper.AddItem("\" + .prnPaper[Counter, 1], Counter)
Else
.cboPaper.AddItem(.prnPaper[Counter, 1], Counter)
Endif
lprninfo = Prtinfo(2,cPrnName)
lprnpaper= .prnPaper[Counter, 2]
If lprninfo = lprnpaper
.cboPaper.ListIndex = Counter
Endif
Endfor
Endwith

**** 35 line lprninfo = Prtinfo(2,cPrnName)

Fatal error: Exception code=C0000005 @ 11.05.2002 02:31 PM. Error log file: C:\Program Files\Common Files\Microsoft Shared\VFP\vfp7rerr.log
Called from - ReportFormPrompt.SetPrnSource line 36 {c:\PF\pf_frm\ReportFormPrompt.sct}

*** procedure SetPrnSource

LOCAL cBinNumbers, cBinNames, nBinCount, Counter
LOCAL cPrnName, cPrnPort,lprninfo

WITH THIS
IF .prnCount = 0
.cboSource.ENABLED = .F.
RETURN
ENDIF
.cboSource.ENABLED = .T.

cPrnName = .PrnArray[.cboPrnName.LISTINDEX, 1]
cPrnPort = .PrnArray[.cboPrnName.LISTINDEX, 2]

*------ get then allocate string sizes required for bin information ------
nBinCount = DeviceCapabilities(cPrnName, cPrnPort, DC_BINS, 0, 0)
cBinNumbers = SPACE((nBinCount*2))
cBinNames = SPACE((nBinCount*24))

*------ retrieve and proccess bin information ------
= DeviceCapabilities(cPrnName, cPrnPort, DC_BINS, @cBinNumbers, 0)
= DeviceCapabilities(cPrnName, cPrnPort, DC_BINNAMES, @cBinNames, 0)

DIMENSION .PrnBins[nBinCount, 2]
.cboSource.CLEAR

ENDWITH
FOR Counter = 1 TO nBinCount
THIS.PrnBins[Counter, 2] = (ASC(SUBSTR(cBinNumbers, (Counter*2), 1))*256) + ;
(ASC(SUBSTR(cBinNumbers, (Counter*2) - 1, 1)))
THIS.PrnBins[Counter, 1] = SUBSTR(cBinNames, ((Counter - 1)*24) + 1 , 24)
IF LEFT(THIS.PrnBins[Counter, 1], 1) = "\"
THIS.cboSource.ADDITEM("\" + THIS.PrnBins[Counter, 1], Counter)
ELSE
THIS.cboSource.ADDITEM(this.PrnBins[Counter, 1], Counter)
ENDIF
lprninfo = PRTINFO(7, cPrnName)
IF lprninfo = THIS.PrnBins[Counter, 2]
THIS.cboSource.LISTINDEX = Counter
ENDIF
ENDFOR

**** 36 line lprninfo = Prtinfo(7,cPrnName)
Next
Reply
Map
View

Click here to load this message in the networking platform