java 向导_使用 Java 类型库向导

使用 Java 类型库向导Using the Java Type Library Wizard

09/18/2015

本文内容

适用于:Access 2013、Office 2013Applies to: Access 2013, Office 2013

The Java Type Library Wizard is a feature of Visual J++ 1.x, integrated into the Tools menu of the development environment. Its purpose is to search a type library and create a Java interface that allows access to COM objects. For Visual J++ 6.0, the Java Type Library Wizard has been replaced with ADO for Windows Foundation Classes.The Java Type Library Wizard is a feature of Visual J++ 1.x, integrated into the Tools menu of the development environment. Its purpose is to search a type library and create a Java interface that allows access to COM objects. For Visual J++ 6.0, the Java Type Library Wizard has been replaced with ADO for Windows Foundation Classes.

Java 类型库向导的执行效果与 Microsoft SDK for Java 中的命令行工具类似。不过,您不能进入向导所生成的类包装中,这一点与 Microsoft SDK for Java 所生成的类包装不同。The Java Type Library Wizard produces similar results as the command-line tools included with the Microsoft SDK for Java. However, you cannot step into the class wrappers that the Wizard generates, unlike the class wrappers generated by the Microsoft SDK for Java.

Java 类型库向导在以下位置生成类: \ \Java\trustlib\msado15.dll。The Java Type Library Wizard generates the classes in the following location: \\Java\trustlib\msado15. 生成类的目录下的 Summary.txt 文件显示了所生成的类定义。The Summary.txt file, located in the directory where the classes were generated, shows the class definitions it generated.

Java 类型库向导将在任何给定类型库中发现的枚举类型转换为 INT(整数)类型。它还定义一个接口,对应于类型库中的每个枚举类型。您可以用以下语法引用 ADO 枚举类型的值:The Java Type Library Wizard converts enumerated types, found in any given type library, to type INT (integer). It also defines an interface that corresponds to each enumerated type in the type library. You can reference the values of an ADO enumerated type with the following syntax:

msado15..

以设置 Command 对象的 CommandType 属性为例,其代码片断如下:An example of this is shown in the following code fragment for setting the CommandType property of a Command object:

Cmd1.putCommandType( msado15.CommandTypeEnum.adCmdStoredProc );

或者,您也可以从 Java 类型库向导所生成的枚举类型包装继承 ADO 对象和枚举值。如果这么做,那么可以从语法中删除"msado15."。不过,类必须从它所引用的每个 Java 对象和枚举类型接口继承,以完全避免在所有 ADO 对象和枚举值之前引用 msado15.*。Alternately, you could inherit from the enumerated type wrapper generated by the Java Type Library Wizard. If so, you could remove "msado15." from the syntax. However, your class would need to inherit from each Java object and enumerated type interface that it references to completely eliminate the need to reference msado15.* in front of all ADO objects and enumerated values.

有关更多示例代码,请参阅 ADO Java 类包装。For more sample code, see ADO Java Class Wrappers.

从 Visual j + + 版本 1. * x 运行 Java 类型库向导*To run the Java Type Library Wizard from Visual J++ version 1.*x*

From the Tools menu, select Java Type Library Wizard.From the Tools menu, select Java Type Library Wizard.

Select "Microsoft ActiveX Data Objects Library" and click OK.Select "Microsoft ActiveX Data Objects Library" and click OK. 这现在 (re \) 将在 trustlib 目录中为 ADO 生成文件 (默认情况下为\c\:\winnt\java trustlib msado15.dll)。This now (re)generates files in the \trustlib directory for ADO (by default at c:\winnt\java\trustlib\msado15). If you used the Microsoft SDK for Java to already generate classes for ADO, they will be replaced with those from the Java Type Library Wizard.If you used the Microsoft SDK for Java to already generate classes for ADO, they will be replaced with those from the Java Type Library Wizard.

To use these files, open your project in Visual J++.To use these files, open your project in Visual J++. 从“工程”**** 菜单中,选择“添加到工程”****。From the Project menu, choose Add To Project. 选择 "文件", 并将所有。在\trustlib 目录中生成的 JAVA 文件 (默认情况下为\c\:\winnt\java trustlib msado15.dll) 到您的项目。Select Files, and add all of the .JAVA files generated in the \trustlib directory (by default at c:\winnt\java\trustlib\msado15) to your project.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值