com4j | Type-safe Java/COM binding

 by   kohsuke C Version: Current License: BSD-2-Clause

kandi X-RAY | com4j Summary

kandi X-RAY | com4j Summary

com4j is a C library. com4j has no vulnerabilities, it has a Permissive License and it has low support. However com4j has 8 bugs. You can download it from GitHub.

Type-safe Java/COM binding
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              com4j has a low active ecosystem.
              It has 129 star(s) with 64 fork(s). There are 18 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 41 open issues and 16 have been closed. On average issues are closed in 47 days. There are 14 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of com4j is current.

            kandi-Quality Quality

              com4j has 8 bugs (0 blocker, 0 critical, 5 major, 3 minor) and 461 code smells.

            kandi-Security Security

              com4j has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              com4j code analysis shows 0 unresolved vulnerabilities.
              There are 4 security hotspots that need review.

            kandi-License License

              com4j is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              com4j releases are not available. You will need to build from source code and install.
              It has 7347 lines of code, 680 functions and 151 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of com4j
            Get all kandi verified functions for this library.

            com4j Key Features

            No Key Features are available at this moment for com4j.

            com4j Examples and Code Snippets

            No Code Snippets are available at this moment for com4j.

            Community Discussions

            QUESTION

            Can JNA be used for a complex Windows DLL like IMAPI
            Asked 2021-Nov-26 at 19:15

            I've managed to get COM4J to use some functionality in the windows IMAPI (CD writing).

            However I've failed to get any of the calls that return SAFEARRAYs working, but this project doesn't appear to be currently active ...

            The DLL is usually in C:\Windows\System32\imapi2.dll, and using it also requires using C:\Windows\System32\imapi2fs.dll

            Looking around for a JAVA-COM bridge project that is active led me to JNA.

            The remit of the project to simplify JAVA-COM bridging intrigued me .... however I fell at the first hurdle, and am hoping someone can help.

            So far I've taken the Microsoft IMAPI examples and written a Powershell application, from which I have the series of calls I need to make to the API.[CDInterface][1]

            The first thing you need to do with IMAPI is create an Instance of IDiskMaster2, so I've declared that via an Imapi2 interface, like so

            ...

            ANSWER

            Answered 2021-Nov-26 at 19:15

            I've answered this in a similar question which I originally marked this as a duplicate of. However, given the difficulty loading this, your case is unique enough that I'll attempt to give a separate answer.

            The general case for COM is that there is an API function that creates the object. You have mapped this as createMsftDiscMaster2(). Note that you have allocated a resource here and it needs to be disposed of when you are done with it; the API documentation should tell you how to do that (possibly by calling Release() from IUnknown.)

            Your next step is to map the IDiscMaster2 COM class. I see two mappings here, so I'm confused as to which one you want. The one at the top of your question is incorrect, but the one extending Dispatch later is the correct way to start, but I'm not clear where you've gone after that. The rest of the class should look similar to the internals of the Dispatch class in JNA.

            In that class you can see the boilerplate that you will follow. Note that it extends Unknown which follows the same boilerplate for offsets 0, 1, and 2 for the first 3 COM functions QueryInterface, AddRef, and Release. Dispatch picks up with offsets 3, 4, 5, and 6 for COM functions GetTypeInfoCount, GetTypeInfo, GetIDsOfNames, and Invoke.

            So in your mapping for DiskMaster2 you will pick up with offset 7, and your mapping will look like:

            Source https://stackoverflow.com/questions/70109741

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install com4j

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/kohsuke/com4j.git

          • CLI

            gh repo clone kohsuke/com4j

          • sshUrl

            git@github.com:kohsuke/com4j.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link