Microsoft KB Archive/257730

= FIX: PrintForm Method of a Form Containing a UserControl Causes IPF =

Article ID: 257730

Article Last Modified on 8/7/2007

-

APPLIES TO

 Microsoft Visual Basic 6.0 Professional Edition, when used with:  Microsoft Windows 95

 Microsoft Windows 98 Standard Edition  Microsoft Visual Basic 6.0 Enterprise Edition, when used with:  Microsoft Windows 95

 Microsoft Windows 98 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q257730

<div class="symptoms_section">

SYMPTOMS
A Visual Basic project crashes with an Invalid Page Fault (IPF) when you try to call the PrintForm method in a form containing a UserControl. This behavior occurs when trying to print to a postscript printer from Microsoft Windows 95 or Microsoft Windows 98. The error message is similar to the following:

This program has performed an illegal operation and will be shutdown.

Clicking on Details may reveal text similar to the following:

VB6 caused a general protection fault in module PSCRIPT.DRV at 0004:00000020.

This problem does not occur on non-postscript printers.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> Create a new Visual Basic Standard EXE project. Form1 is created by default.</li> Add a CommandButton control to Form1.</li> From the File menu, select Add Project to add a new ActiveX Control project to the project group.</li> Add a PictureBox control to UserControl1 and make sure that the AutoRedraw property of PictureBox1 is set to True.</li>  Paste the following code into the code window of Usercontrol1: Private Sub UserControl_Initialize Picture1.Line (0, 0)-(2000, 2000) End Sub </li> Close the design window of the UserControl and add a UserControl1 to Form1 in Project1.</li>  Paste the following code into Form1's code window: Private Sub Command1_Click Me.PrintForm End Sub </li> Run the project and click the CommandButton. Note that the Invalid Page Fault occurs.</li></ol>

Additional query words: sp4 GPF

Keywords: kbbug kbctrl kbfix kbprint kbvs600sp4fix kbvs600sp5fix KB257730

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.