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

Problem with JavaBeans AciveX controls Drag and Drop problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.3.0
    • deploy
    • None
    • x86
    • windows_nt

      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.

      Java drag & drop does not work at all because the drop target does
      not receive any event.

      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 can t set
      the list selection with the keyboard anymore.

            jmelvin James Melvin (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: