使用开源中的:jacob. 可以在网上查到他的一些相关资料.
有两个文件很重要:jacob.jar,jacob.dll
请把jacob.jar加入到类路经中,把jacob.dll加到java JDK中的jre/bin下.
就可以使用了.
/
package test;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class TestDll
{
public static void main(String [] args)
{
ActiveXComponent mf = new ActiveXComponent("wm.bb");//找到组件
Object myCom = mf.getObject();//生成一个对象
Variant result= Dispatch.call( (Dispatch) myCom, "zmbb",new Variant( "刘正仁"),new Variant( "王敏"),new Variant( "刘正仁"),new Variant( "刘正仁"),new Variant( "刘正仁"));
System.out.println(result.getString());
}
}