FIX: NullReferenceException When You Print in Windows 98 or Windows Millennium Edition (320898)
The information in this article applies to:
- Microsoft .NET Framework 1.0
This article was previously published under Q320898 SYMPTOMS
When you use the PrintDocument class to print, a NullReferenceException exception occurs in System.Windows.Forms.BackgroundThread.UpdateLabel() on computers that are running Microsoft Windows 98 or Microsoft Windows Millennium Edition (Me). The PrintPreview class can also cause this problem.
The following text appears in the exception details:
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.BackgroundThread.UpdateLabel()
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPage(PrintDocument document, PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at PrintingExample.printButton_Click(Object sender, EventArgs e) in c:\source\delmeone\form1.cs:line 34
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
RESOLUTIONTo resolve this problem, obtain the latest service pack for Microsoft .NET Framework. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
318836 INFO: How to Obtain the Latest .NET Framework Service Pack
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2).
This problem is resolved in the release of the .NET Framework that will coincide with the version 7.1 release of Visual Studio .NET.
Modification Type: | Major | Last Reviewed: | 2/9/2004 |
---|
Keywords: | kbbug kbfix kbQFE KB320898 |
---|
|