Following the "Bridge of Java Connection COM Object" articles, I received a lot of netizens, discussing Jacob
The problem is issued, this continuation is to solve the Jacob transfer array to COM and the extraction of COM from COM for the modified array parameters. turn off
The use of Jacob is not detailed here. Please see the "Bridge of the Java Connection COM object", which is implemented as follows: import com.jacob.ActiveX. *;
public class Exam_6 {public static void main (String [] args) {ActiveXComponent pp = new ActiveXComponent ( "PrjCOM.MyCOM"); try {SafeArray sa = new SafeArray (Variant.VariantString, 2); Variant var = new Variant () Sa.fromstringArray (new string [] {"h", "h"}); var.putsafeArrayref (sa); // Transfer array reference address // If only one array is entered, do not need to obtain the change after the change You can use PutsafeArray method Dispatch.call (PP, "TEST", var); string [] Sack = sa.toStringArray (); system.out.println (Sack [0] "/ t" Sack [1]) ;} catch (Exception e) {e.printStackTrace ();}}} Com VB to achieve the following objects VERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0' NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0' vbNone MTSTransactionMode = 0 'NotAnMTSObjectENDAttribute VB_Name = "MyCOM" Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TruePublic Sub Test (ByRef param () As String) ReDim param (2) param (0) = "Hello" param (1) = "World "END SUB
Compilation Exam_6.java Print Hello World
Have doubt zlesssson@163.net