本文整理汇总了Java中com.jacob.com.Variant.toDispatch方法的典型用法代码示例。如果您正苦于以下问题:Java Variant.toDispatch方法的具体用法?Java Variant.toDispatch怎么用?Java Variant.toDispatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jacob.com.Variant
的用法示例。
在下文中一共展示了Variant.toDispatch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWmiValueHash
import com.jacob.com.Variant; //导入方法依赖的package包/类
private long getWmiValueHash(String classname, String propertyname) {
Long result = 1L;
result *= result.hashCode();
try {
EnumVariant enumVariant = Query("select * from " + classname);
Dispatch item;
while (enumVariant.hasMoreElements()) {
Variant nitem = enumVariant.Next();
if (nitem == null) {
continue;
}
item = nitem.toDispatch();
if (item == null) {
continue;
}
String ret = Dispatch.call(item, propertyname).toString();
if (ret != null) {
result *= ret.hashCode();
}
}
} catch (Exception e) {
log.error("查询 WMI 失败。", e);
}
return result;
}
示例2: Query
import com.jacob.com.Variant; //导入方法依赖的package包/类
public EnumVariant Query(String query) {
try {
Variant vCollection = WmiServer.invoke("ExecQuery", new Variant(
query));
EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
return enumVariant;
} catch (Exception e) {
log.error("查询 WMI 失败。", e);
}
return null;
}
示例3: add
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Stock add(String ticker) {
Variant vStock = Dispatch.call(dStocks, "Add", new Variant(ticker));
return !vStock.isNull() ? new Stock(vStock.toDispatch()) : null;
}
示例4: item
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Stock item(String ticker) {
Variant vStock = Dispatch.call(dStocks, "Item", new Variant(ticker));
return !vStock.isNull() ? new Stock(vStock.toDispatch()) : null;
}
示例5: open
import com.jacob.com.Variant; //导入方法依赖的package包/类
public AnalysisDoc open(String fileName) {
Variant vResult = Dispatch.call(dAnalysisDocs, "Open",
new Variant(fileName));
return !vResult.isNull() ? new AnalysisDoc(vResult.toDispatch()) : null;
}