BUG: Resource Manager Error When Printing Lots of Fonts (108717)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q108717

SYMPTOMS

When FoxPro is printing a large number of fonts under Windows 3.x (16-bit Windows), FoxPro displays the following error message:
Resource Manager Internal Consistency Error
Additionally, Visual FoxPro then displays the following error message:
Win32s - Error Unhandled Exception detected. Application will be terminated.
NOTE: Visual FoxPro 3.0b for Windows prints a much greater number of fonts than Visual FoxPro 3.0 for Windows does before displaying the error message.

CAUSE

FoxPro is not properly releasing graphics device interface (GDI) resources under Windows.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Problem

The following program demonstrates the problem:
SET TALK OFF
CLEAR
m.points = 10
@ 12,20 SAY 'Enter the point size ' GET m.points PICTURE '99'
READ
@ 12,0
@ 12,30 SAY 'Printing'
SET CONSOLE OFF
IF afont[FONTS]
   SET PRINT ON
   _PLINENO = 56
   m.counter = 1
   m.numfonts = ALEN(fonts,1)
   DO WHILE m.counter <= m.numfonts
      m.this_font = LTRIM(fonts(m.counter))
      SET CONSOLE ON
      @ 12,39 SAY SPACE(20)
      @ 12,39 SAY m.this_font
      SET CONSOLE OFF
      AFONT(sizes,(m.this_font))
      IF _PLINENO > 52
         DO rpthead
      ENDIF
      ?
      ? 'This is a 10 point sample of ' + m.this_font
      IF ALEN(sizes) = 1 .AND. TYPE('sizes(1)') = 'L' .AND. sizes(1) = .T.
         ?? '. This is a scalable font.'
      ENDIF
      ?   'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + ;
          'abcdefghijklmnopqrstuvwxyz' + ;
          '1234567890!@#$%^& ; ())' FONT m.this_font,m.points
      ? 'This is ' + m.this_font + ' bold.'
      ?   'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + ;
          'abcdefghijklmnopqrstuvwxyz' + ;
          '1234567890!@#$%^& ; ())' FONT m.this_font,m.points STYLE 'B'
      ? 'This is ' + m.this_font + ' italic.'
      ?   'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + ;
          'abcdefghijklmnopqrstuvwxyz' + ;
          '1234567890!@#$%^& ; ())' FONT m.this_font,m.points STYLE 'I'
      ? 'This is ' + m.this_font + ' underline.'
      ?   'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + ;
          'abcdefghijklmnopqrstuvwxyz' + ;
          '1234567890!@#$%^& ; ())' FONT m.this_font,m.points STYLE 'U'
      m.counter = m.counter + 1
   ENDDO
   EJECT
   SET PRINT OFF
   SET CONSOLE OFF
ENDIF
RETURN

PROCEDURE rpthead
EJECT
_PLINENO = 1
?
? 'A LISTING OF YOUR AVAILABLE WINDOWS FONTS' AT 25
? '-----------------------------------------' AT 25
?
RETURN
				

Modification Type:MajorLast Reviewed:5/6/2003
Keywords:KB108717