Microsoft SDK for Java

Q223363 FIX: Unhandled Exception When Hosting Java ActiveX Controls

The information in this article applies to:

SYMPTOMS

Java Beans registered as Microsoft® ActiveX® controls might cause a memory fault when exiting if the hosting application/window is a WFC-based Form.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in Microsoft® Visual Studio® 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

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

Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

MORE INFORMATION

Steps to Reproduce Behavior

  1. Register a Java AWT-based Bean Widget as an ActiveX control using javareg:
    javareg /register /control /class:ClassName /codebase:PathToClassFile 
    /typelib:NameOfTypeLibraryFile.tlb
    

    (See the SDK For Java documentation for more information on the javareg tool.)

  2. Open a new Visual J++ 6.0 Windows Application project.

  3. Customize the toolbox (right-click) and add the newly-registered control to the toolbox (ActiveX tab).

  4. Select the new control from the toolbox and add it to the form.

  5. View the code of the WFC Form. After the initForm call, set the text or title of the Bean/Control with a call to setText/Title.

  6. Run the application in the debugger [F5].

  7. Close the Form by clicking on the [x] in the upper-right corner of the window.

    Results:

    An error dialog will pop up with a memory access violation message.

REFERENCES

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, please see the following pages on the Microsoft Technical Support site:

http://support.microsoft.com/support/visualj/ This link takes you to a site on microsoft.com

http://support.microsoft.com/support/java/ This link takes you to a site on microsoft.com

© 1999 Microsoft Corporation. All rights reserved. Terms of use.