Microsoft KB Archive/294692

= Java Applet That Uses Frame.setFrameIcon Causes an Invalid Page Fault in User.exe =

Article ID: 294692

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Windows Millennium Edition
 * Microsoft Windows 98 Second Edition
 * Microsoft Windows 98 Standard Edition
 * Microsoft Visual J++ 6.0 Standard Edition

-



This article was previously published under Q294692



SYMPTOMS
When you develop or use a Java applet that uses the AWT Frame.setFrameIcon method on the same icon on multiple frames, you may receive the following error message:

IEXPLORE caused a general protection fault

in module USER.EXE at 0003:0000a3e



CAUSE
When you implement Frame.setIconImage, it assumes that it owns the image associated with the frame. On each call to setIconImage, the native code frees a handle to an icon and creates a new one. As a result, Windows tries to free an icon two times and the computer does not work as expected.



RESOLUTION
To work around this behavior, do not set a frame object's icon more than one time and do not use an image object instance to set the icon of more than one frame. For example, if your program uses ImageLoader's getImage method to load an icon image into a global variable, make a copy of the image before you set the image on each frame: img = Loader.getImage(&quot;APPICON.GIF&quot;); Image img1 = img.getScaledInstance (-1, -1, Image.SCALE_DEFAULT); ((Frame)(this.getDecorator)).setIconImage(img1);



STATUS
This behavior is by design.

Keywords: kbprb kbqfe KB294692

-

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

© Microsoft Corporation. All rights reserved.