PRB: JBrowser Sample Does Not Compile with Internet Explorer 5.5 (306147)



The information in this article applies to:

  • Microsoft SDK for Java 3.0
  • Microsoft SDK for Java 3.0 Preview 1
  • Microsoft SDK for Java 3.1
  • Microsoft SDK for Java 3.2
  • Microsoft SDK for Java 4.0
  • Microsoft Internet Explorer (Programming) 5.5

This article was previously published under Q306147

SYMPTOMS

If you build the Microsoft JBrowser sample on a system with Internet Explorer 5.5 and later, the compilation step fails with several J0063 errors. The following error message is one example of a failed build.
nmake.exe MAKEFILE<BR></BR> Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

jactivex.exe -d . C:\WINNT.1\SYSTEM32\shdocvw.dll
Microsoft ActiveX Control Importer For Java V5.00.3601
Copyright (C) 1997-1999 by Microsoft Corporation.
jvc.exe -nologo -nomessage -x- -d . *.java shdocvw\*.java
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.WindowSetResizable(boolean Resizable)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.WindowSetLeft(int Left)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.WindowSetTop(int Top)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.WindowSetWidth(int Width)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.WindowSetHeight(int Height)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.WindowClosing(boolean IsChildWindow, boolean[] Cancel)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.ClientToHostWindow(int[] CX, int[] CY)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.SetSecureLockIcon(int SecureLockIcon)'
JBrowser.java(65,41) : error J0063: Declare the class abstract, or implement abstract member 'void WebBrowserEventListener.FileDownload(boolean[] Cancel)'
JBrowserOpen.java(28,3) : error J0082: Class 'Dialog' doesn't have a constructor that matches 'Dialog(JBrowser, String, boolean)'
NMAKE : fatal error U1077: 'jvc.exe' : return code '0x1'
Stop.

CAUSE

The cause of this failure is an incompatibility between the sample source code and an updated event model in the browser control that was included with Internet Explorer 5.5.

RESOLUTION

To work around this problem, add event handlers for the new events. This satisfies implementation requirements for the event interface. For more information about how to modify the JBrowser.java file, see the "More Information" section.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Modify the JBrowser.java file as follows:
    // Changes are for Internet Explorer 5.5 compatibility.
    // 
    // JBrowser Internet Explorer 5.5
    // 
    // This class adds empty methods for new Internet Explorer 5.5 events on    
    // the WebBrowserEventListener class interface. The original  
    // JBrowser class has been marked abstract and subclassed by this one.
    
    class JBrowserIE55 extends JBrowser { 
    	public void WindowSetResizable(boolean resizable){}
    	public void WindowSetLeft(int Left){}
    	public void WindowSetTop(int Top){}
    	public void WindowSetWidth(int Width){}
    	public void WindowSetHeight(int Height){}
    	public void WindowClosing(boolean IsChildWindow, 
                                       boolean[] Cancel){}
    	public void ClientToHostWindow(int[] CX, int[] CY){}
    	public void SetSecureLockIcon(int SecureLockIcon){}
    	public void FileDownload(boolean[] Cancel){}
    
            //The following methods are required for Internet Explorer 6.0
            //and later.
    
       	public void NavigateError(Object pDisp,
                                       Variant URL,
                                       Variant Frame,
                                       Variant StatusCode,
                                       boolean[] Cancel){}
       	public void PrintTemplateInstantiation(Object pDisp){}
       	public void PrintTemplateTeardown(Object pDisp){}
       	public void UpdatePageStatus(Object pDisp,
                                          Variant nPage,
                                          Variant fDone){}
       	public void PrivacyImpactedStateChange(boolean bImpacted){}
    }
    					
  2. Change to an abstract class for Internet Explorer 5.5 compatibility:
    abstract class JBrowser extends Frame 
        implements IUIActionListener, 
                   ActiveXControlListener, 
                   WebBrowserEventListener
    					
  3. Use the new class to create a JBrowser object:
    	/**
    	 * This is the main method that creates a JBrowser object.
    	 * @param	String[]	The command line parameters:
    	 */ 
    	public static void main(String[] args)
    	{
    		//new JBrowser();
    		new JBrowserIE55();
    	}
    					

REFERENCES

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:6/14/2006
Keywords:kbJava kbprb KB306147