| Real'sHowTo |
|
|
Custom Search
|
| Real'sHowTo |
|
|
Custom Search
|
First generate Java type definitions from a COM type library. Here we are doing for the type library for the Windows Scripting Host.
> java -jar tlbimp.jar -o wsh -p test.wsh %WINDIR%\system32\wshom.ocx
Then we are able to call WSH objects/methods.
public class Main {
public static void main(String[] args) {
IFileSystem3 fs = ClassFactory.createFileSystemObject();
for( String file : args )
System.out.println(fs.getFileVersion(file));
}
}
http://sourceforge.net/projects/j-interop
http://sourceforge.net/projects/j-xchange/
See also this HowTo for an alternative package to access a COM package from Java.
Written and compiled by Réal Gagnon ©1998-2013
[ home ]