Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report output GDI+ issues
Message
 
To
18/03/2021 12:55:25
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01679057
Message ID:
01679076
Views:
53
My tests create and run a simple report with no special report listener.
Here is the code, you could run it in a fresh VFP instance. It will create a 10 page report, prompt to print it (you may select print to PDF), and then it will display the GDI object count before and after the report. In the problem environments, the GDI object count difference after the report printed is in the range of 5000+ , when normally it should be no difference between the count before.
Again, many thanks for your help.
**************************************************
*-S-03/17/21-*[ report VFP report GDI object usage
LPARAMETERS tnRptBehavior
**************************************************

LOCAL i, g0, g1, lcFrx, lnSetRB, loEx, lcMsg, lnRB, lcRB
*
DECLARE Long GetCurrentProcess IN kernel32.dll 
DECLARE Long GetGuiResources IN user32.dll Long hProcess, Long uiFlags
*
lnSetRB = SET("ReportBehavior")

lnRB = IIF(VARTYPE(m.tnRptBehavior) = "N" AND INLIST(m.tnRptBehavior, 80, 90), m.tnRptBehavior, 90)
SET REPORTBEHAVIOR (m.lnRB)
*
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)
	*
	lcRB = TRANSFORM(SET("ReportBehavior"))
	WAIT WINDOW "ReportBehavior " + m.lcRB NOWAIT
	
	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 USED('xTestGDIobj')
	USE IN xTestGDIobj
ENDIF
*
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, 64, "ReportBeahvior " + m.lcRB)
>Anyway, would you be so kind to tell me more about the Reportlistener used? Is this something different then standard?

>>I have several PCs that I set to different OS builds.
>>The solution for now is the following:
>>For W10 20H2 -> uninstall KB5000802
>>For W10 2004 -> uninstall KB5000802
>>For W10 1909 -> uninstall KB5001567, if installed. Then, uninstall KB5000802 and KB5000808, if any of them there.
>>Your suggestion to remove KB5000802 made the difference. Thank you so much!
>>
>>Sorin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform