BUG: Invalid Index Passed to Screen.Fonts Collection Causes GPFLast reviewed: February 5, 1998Article ID: Q180526 |
The information in this article applies to:
SYMPTOMSAn application error may occur within the Windows CE emulator (pvb.exe) if an invalid index is passed to the Screen.Fonts collection. The error is as follows:
The instruction at "0x01000a68b" referenced memory at "0x00000034". The memory could not be "read".On the actual Windows CE device, this error causes the application to end without an error dialog.
RESOLUTIONEnsure that the index that is passed to the Screen.Fonts collection is valid. The following code sample shows how a function (IsValidFontIndex) can be used to ensure that the error does not occur:
Option Explicit Private Sub Command1_Click() Dim iFontNumber 'Set iFontNumber to an invalid Screen.Font index value. iFontNumber = Screen.FontCount If IsValidFontIndex(iFontNumber) Then Command1.Font = Screen.Fonts(iFontNumber) Else 'Insert some other error handling or set 'the font to a default font. MsgBox "Invalid Font Index" End If End Sub Private Function IsValidFontIndex(Index) If Index >= Screen.FontCount Then IsValidFontIndex = False Else IsValidFontIndex = True End If End Function STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce BehaviorWARNING: The following code sample will produce an application error in PVB.EXE.
Keywords : vb5all vbce Version : WINDOWS:1.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbpending |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |