Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report output GDI+ issues
Message
 
À
17/03/2021 20:27:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01679057
Message ID:
01679062
Vues:
72
Thank you, Tore and Al for your suggestions.
It doesn't seem to be a printer related issue. I downgraded W10 to prior versions; the problem occurs in the recent update 20H2 and 20H1, yet it behaves properly in 1909.
Apparently, GDI objects used by the report engine are not released properly in the recent Windows updates.
The following code will create a 10 page report and prompt to print it. I'd appreciate if anyone could run it in VFP9 SP2 (select Print to PDF) and post the results, together with the current Windows 10 release date.
My results

in W10 1909:
GDI object before report: 473
GDI object after report: 473
in W10 20H2
GDI object before report: 173
GDI object after report: 5180 (?!)
**************************************************
*-S-03/17/21-*[ report VFP report GDI object usage
**************************************************

LOCAL i, g0, g1, lcFrx, lnSetRB, loEx, lcMsg
*
DECLARE Long GetCurrentProcess IN kernel32.dll 
DECLARE Long GetGuiResources IN user32.dll Long hProcess, Long uiFlags
*
lnSetRB = SET("ReportBehavior")
SET REPORTBEHAVIOR 90
*
lcMsg = ""
lcRpt = SYS(2015)
lcFrx = m.lcRpt + ".frx"
lcFrt = m.lcRpt + ".frt"
*
TRY
	CREATE CURSOR xTestGDIobj (f1 C(32), f2 C(32), f3 C(32), f4 c(32))
	*
	FOR i = 1 TO 300
		*
		INSERT INTO xTestGDIobj (f1, f2, f3, f4) ;
			VALUES ;
			(REPLICATE('a', 32), REPLICATE('b', 32), REPLICATE('c', 32), REPLICATE('d', 32))
		*
	ENDFOR
	*
	CREATE REPORT (m.lcRpt) FROM DBF('xTestGDIobj')
	*
	g0 = GetGuiResources(GetCurrentProcess(), 0)
	*
	REPORT FORM (m.lcRpt) TO PRINTER PROMPT NOCONSOLE
	*
	g1 = GetGuiResources(GetCurrentProcess(), 0)
	*
CATCH TO m.loEx
	lcMsg = m.loEx.Message
ENDTRY
*
SET REPORTBEHAVIOR (m.lnSetRB)
*
IF FILE(m.lcFrx)
	ERASE (m.lcFrx)
ENDIF
*
IF FILE(m.lcFrt)
	ERASE (m.lcFrt)
ENDIF
*
lcMsg = EVL(m.lcMsg, "GDI objects before: " + TRANSFORM(m.g0) + CHR(13) + "GDI objects after:  " + TRANSFORM(m.g1))
MESSAGEBOX(m.lcMsg)
>>VFP9 SP2 on Windows 10 20H2
>>Suddenly, we started receiving complaints re report printing from several clients who have been using our app with no such issues until today. The reports are normal daily reports; 10 - 20 pages.
>>What we determined, so far:
>>When report is run for the first time, it prints ok on several pages (6 - 7 pages), after which it outputs all pages blank. As soon as that happens, any attempts to run reports result in blank output to printer (or PDF with 0 KB), trashed display of form controls on screen, images missing from toolbar buttons, etc. Eventually, the app will crash either with a "Resource manager internal consistency error" or with "GDI+ insufficient resources".
>>We suspect that a recent W10 update may have something to do with it.
>>* Tested REPORTBEHAVIOR 80 and 90 with the same results
>>* We looked for registry settings for GDIProcessHandleQuota and USERProcessHandleQuota, but apparently they're not preset in Windows 10.
>>Any other suggestions appreciated.
>
>In addition to Tore's suggestion, you could see if there is an updated printer driver from the manufacturer. One of my clients had issues with a printer starting last week (when he installed the most recent Patch Tuesday updates). He downloaded and installed a new driver dated March 8 and all is well now.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform