Technical report C2/2006, Department of Mathematical Information Technology, University of Jyväskylä, 2006 [bib]. ProLaatuPro project.
An approach to Java-COM integration using typesafe COM interface wrappers is presented with source code and examples using Microsoft Office applications. The technique is based on jcom, java2com and JACOB libraries and compared with other open source Java-COM integration packages. XML wrapper and code generator could be bundled with future JACOB releases as an alternative to Jacobgen wrapper generator.
Releases include modified JACOB 1.10.1 distribution, Lewis' XMLGen and Codegen adapted to Java 1.5, and examples using Microsoft Word, Excel & Visio 2003 with generated wrappers. NetBeans 5 (Ant) is used for project files.
IDispatch sh = workbook.getActiveSheet(); _Worksheet[] out_sheet = { null }; _Worksheet sheet; sh.QueryInterface(out_sheet); sheet=out_sheet[0];can alternatively (without type safety) be written as:
IDispatch sh = workbook.getActiveSheet(); _Worksheet sheet = (_Worksheet)sh.QueryInterface(_Worksheet.class);
Robert Hastings, 20.8.2008.
Miika Nurminen - (minurmin at
jyu.
fi)
Last update: 21.08.2008