Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How do I use a COM component in Java?

How do I use a COM component in Java?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++javacomlearning
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    melwyn
    wrote on last edited by
    #1

    Hi, I read in a book on COM that COM is language independent viz. you can create and use COM components in any language. I was wondering how do I go about using a COM component (created in VC++) in a Java client program? Thanks, Melwyn

    A 1 Reply Last reply
    0
    • M melwyn

      Hi, I read in a book on COM that COM is language independent viz. you can create and use COM components in any language. I was wondering how do I go about using a COM component (created in VC++) in a Java client program? Thanks, Melwyn

      A Offline
      A Offline
      antlers
      wrote on last edited by
      #2

      There is a Sun-approved way, which is to create a native interface that implements the COM interface, and create a DLL with JNI that implements the native interface using the COM object. This will work with any modern JVM. Microsoft's JVM (which I don't think is supported any longer) had another way, which I don't recall the details of, that let you use a COM object directly from Java.

      M 1 Reply Last reply
      0
      • A antlers

        There is a Sun-approved way, which is to create a native interface that implements the COM interface, and create a DLL with JNI that implements the native interface using the COM object. This will work with any modern JVM. Microsoft's JVM (which I don't think is supported any longer) had another way, which I don't recall the details of, that let you use a COM object directly from Java.

        M Offline
        M Offline
        melwyn
        wrote on last edited by
        #3

        Hi, Thank you for your reply. That solved my doubt as far as using a COM component is concerned. How about creating a COM component in Java? Books on COM say that you can creat a COM component in any language....even COBOL!!! I suspect as usual Microsoft people make statements they can't back up. Thanks, Melwyn

        A 1 Reply Last reply
        0
        • M melwyn

          Hi, Thank you for your reply. That solved my doubt as far as using a COM component is concerned. How about creating a COM component in Java? Books on COM say that you can creat a COM component in any language....even COBOL!!! I suspect as usual Microsoft people make statements they can't back up. Thanks, Melwyn

          A Offline
          A Offline
          antlers
          wrote on last edited by
          #4

          Again, there is a Microsoft JVM-specific way which is (supposed to be) simple-- and the JNI way, in which case you create a C/C++ COM wrapper for your Java object. The wrapper would incorporate the JVM and call it to process COM requests in your Java object.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups