swt java 内嵌ActiveX控件
这里用的是SWT/JFace开发application中SWT自带的org.eclipse.swt.ole.win32 包可以支持内嵌OLE和ActiveX。 具体用法如下: //创建一个OleFrame做为OLE(或ActiveX)的框架 OleFrame oleFrame = new OleFrame(this, SWT.NONE); //创建ActiveX的容器,其中的classID是ActiveX的classid,在注册表中可以找到 OleControlSite oleControl = new OleControlSite(oleFrame, SWT.NONE, “classID”); //OleAutomation类用来执行ActiveX中的方法 OleAutomation oleAutomation = new OleAutomation(oleControl); //将ActiveX显示在application中 oleControl.doVerb(OLE.OLEIVERB_SHOW); 调用AcitveX中方法的具体过程: 1、不带参数的方法调用 //获取Method Name的ID,Method Name为ActiveX中具体的方法名 int[] regspid = oleAutomation.getIDsOfNames(new String[] {