Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4428838

Problem with JavaBeans AciveX controls Focus problem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.2.2, 1.3.0, 1.3.1, 1.4.0
    • Fix Version/s: 1.3.0_05
    • Component/s: deploy
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      05
    • CPU:
      x86
    • OS:
      generic, windows_nt

      Backports

        Description

        Our Java Beans do not work correctly if they are packed with
        ActiveX-Packager.

        We created swing based beans with JDK 1.3 and packed them with the Sun
        ActiveX-Packager.
        Then we build ActiveX controls from the typelibraries with MSVC++ 6.0.
        Testing the controls in a MSVC++ MDI application the controls show some
        strange behavior.

        If the MDI Child regaines the focus no more key stroke reaches the
        control. The control renders the focus correct and the focus can be set
        on subcomponents inside the control by the mouse.

        Our controls work fine in a pure Java application.

        An example is attached.

        To get test this to work:

        customize the paths in file dndtest\java\ActiveX\DnD2ListPanel.reg

            * beans.ocx (e.g. C:\Programme\JavaSoft\JRE\1.3\bin\)
            * dndtest.jar
            * DnD2ListPanel.tlb
            * s:\java\activex

        - regedit DnD2ListPanel.reg.

        - Run dndtest\mditest\Debug\mditest.exe.

        If the MDI does not containe anything please resize it.

        If the list does not appear in the MDI panel then the application will rebuilding.

        (1) Remove the registration of the bean with WUnregBean in plugin directory.

        (2) Use the Packager to register the bean and create the DnD2ListPanel.reg and DnD2ListPanel.tlb files in dndtest\java\ActiveX. (make sure the register is ticked)

        (3) cd dndtest\mditest

        delete dnd2listpaneldispatch.cpp
               dnd2listpaneldispatch.h


        (4) Create the C++ dispatch classes we used M$ VC++ 6.0. There s a
        menu entry in the "Project" menu that let you add files to the current
        project. That menu item has a submenu called "Components and controls.." (or
        something like that). Clicking on that menu item brings up a dialog box. In that
        dialog double click on "Registered AciveX controls". There you should find an
        entry "DnD2ListPanel Bean Control". Insert this control in the project.

        (5) Change in the CChildFrame::OnCreate method the following line
        m_list2.CreateControl(_T("{1E589CF0-01C2-11D5-9C01-00105ACD1A9D}"),
        ....

        Instead of {1E....9D} you have to copy the registry key from the
        DnD2ListPanel.reg created in step 2



        (6) Rebuild the application (Rebuild all).

        (Note I had a problem here I had to remove the refernce to header and code.
        Projects-->sSettings

        mditest--->Header -- exclude dnd2listpaneldispatch.h

               --->Code --- exclude dnd2listpaneldispatch.cpp

        )

        When the build gets under way you will get an error saying that the dnd2listpaneldispatch.h is missing.

        Change the code affected in the error to

        dnd2listpaneldispatch1.h this will then compile.

        Now you should be able to run the application in the visual studio.
        If the mdi child shows no content just play around and resize the mdi child a
        little bit.

        (7) To readjust our problem: switch between the applications. After
        switching back to the test application it will not react on any keyboard input. This means you cant set the list selection with the keyboard anymore.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                asultano Alex Sultanov
                Reporter:
                duke J. Duke (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: