com4j

Error com4j.ComException: 80004005 .\invoke.cpp:51 while getting open windows and selected items

亡梦爱人 提交于 2019-12-13 02:37:40
问题 I need to get all selected files and folders in Windows Explorer. I'm using com4j to access win Shell32 API (thanks to Tom91136, refer this if you need to learn how can you install and initialize com4j) . This code class gets the selected files or folders in Windows Explorer and prints. import java.io.File; import com4j.*; import test.wsh.*; import java.util.*; import java.util.Timer; import javax.swing.*; public class DetectSelection { public static void main(String[] argv) { list(); //there

Failed to execute COM class: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153

元气小坏坏 提交于 2019-12-11 17:36:17
问题 I'm trying for some days to execute a ".dll" file from an JAVA application. If you are interested you can read my first question: Call a .dll function using command line I used "com4j" to create the COM classes for my DLL. The generated classes looks good and I tried to execute the code, more exactly a method called "getUnitInfo" located in a class called "_Tester": @DISPID(1610809376) //= 0x60030020. The runtime will prefer the VTID if present @VTID(8) int getUnitInfo( java.lang.String

com4j on Windows 64 bit

谁都会走 提交于 2019-12-03 21:10:19
问题 I've downloaded the latest com4j jars and I'm trying to run through the most simple of their examples. I'm on Windows 7 64 bit and using a 64 bit JVM. When I run the command (from the com4j tutorial): java -jar tlbimp.jar -o wsh -p test.wsh %WINDIR%\system32\wshom.ocx I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: com4j-amd64.dll: %1 is not a valid Win32 application at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown

Connect 64bit Java with 32bit COM dll using Com4j or Jacob

◇◆丶佛笑我妖孽 提交于 2019-12-01 10:34:16
I have the following configuration: 1) Windows 10 64-bit 2) An application that has only a 32-bit version and is available through COM. I access the .dll file of the 32-bit application using the tlbimb.jar to generate the interfaces needed and I succeed. Scenario 1: I try to access the 32-bit application using the Java 8 32-bit installation. I can invoke the methods through COM succesfully without any problem. Scenario 2: I try to access the 32-bit application using a Java 8 64-bit installation. I get an error message: Exception in thread "main" com4j.ExecutionException: com4j.ComException:

Connect 64bit Java with 32bit COM dll using Com4j or Jacob

我的梦境 提交于 2019-12-01 07:38:03
问题 I have the following configuration: 1) Windows 10 64-bit 2) An application that has only a 32-bit version and is available through COM. I access the .dll file of the 32-bit application using the tlbimb.jar to generate the interfaces needed and I succeed. Scenario 1: I try to access the 32-bit application using the Java 8 32-bit installation. I can invoke the methods through COM succesfully without any problem. Scenario 2: I try to access the 32-bit application using a Java 8 64-bit

com4j on Windows 64 bit

回眸只為那壹抹淺笑 提交于 2019-11-30 23:01:33
I've downloaded the latest com4j jars and I'm trying to run through the most simple of their examples. I'm on Windows 7 64 bit and using a 64 bit JVM. When I run the command (from the com4j tutorial): java -jar tlbimp.jar -o wsh -p test.wsh %WINDIR%\system32\wshom.ocx I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: com4j-amd64.dll: %1 is not a valid Win32 application at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0(Unknown Source) at