Microsoft KB Archive/108658

= FIX: GPF with Long Formulas in Crystal Reports Custom Control =

Article ID: 108658

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q108658



SYMPTOMS
Loading the Formulas array property with long strings at run time can cause a general protection (GP) fault. The following problem applies to CRYSTAL.VBX, the Crystal Report custom control file.



CAUSE
This is a memory management problem in the CRYSTAL.VBX control that ships with Visual Basic version 3.0.



RESOLUTION
The newest version of CRYSTAL.VBX corrects this problem. You can download the latest CRYSTAL.VBX file by modem from the Crystal Services bulletin board system (BBS) at (604) 681-9516. In the Crystal Services BBS, download the VBVBX.ZIP file from the Files section.



STATUS
This bug is corrected by the latest version of CRYSTAL.VBX.



Steps to Reproduce Behavior
 Start a new project in Visual Basic. Form1 is created by default. Choose Add File from the File menu. Add the CRYSTAL.VBX file from your WINDOWS\SYSTEM directory. CRYSTAL.VBX is the Crystal custom control file. Add a Crystal custom control to Form1.  Double-click the form to open the code window. Add the following code to the Form Load event: Sub Form_Load For i = 0 to 10 Report1.Formulas(i) = Space$(200) Next i  End Sub

 Start the program, or press the F5 key. A GP fault may occur on some computers.</li></ol>

If you replace Space$(200) with Space$(110), the form loads but the GP fault may occur when you unload the form. If you change to Space$(100), the program may run without error. The exact behavior depends upon the current memory state of your Windows session.

<div class="references_section">