本文整理汇总了Java中org.jinterop.dcom.core.JIFlags类的典型用法代码示例。如果您正苦于以下问题:Java JIFlags类的具体用法?Java JIFlags怎么用?Java JIFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JIFlags类属于org.jinterop.dcom.core包,在下文中一共展示了JIFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addGroup
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public AddGroupResult addGroup(String name, boolean active, int requestedUpdateRate, int clientGroup, Integer timeBias, Float percentDeadband, int lcid, String iid) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCServer_AddGroup);
callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
callObject.addInParamAsBoolean(active, JIFlags.FLAG_NULL);
callObject.addInParamAsInt(requestedUpdateRate, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
callObject.addInParamAsInt(clientGroup, JIFlags.FLAG_NULL);
callObject.addInParamAsPointer(new JIPointer(timeBias != null ? timeBias : new Integer(0)), JIFlags.FLAG_NULL);
callObject.addInParamAsPointer(new JIPointer(percentDeadband != null ? percentDeadband : new Float(0.0)), JIFlags.FLAG_NULL);
callObject.addInParamAsInt(lcid, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL); //out param phServerGroup
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL); //out param pRevisedUpdateRate
callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL); // out param ppUnk
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return new AddGroupResult(
(Integer) result[0],
(Integer) result[1],
JIObjectFactory.narrowObject((IJIComObject) result[2]));
}
示例2: getState
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public GroupState getState() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Boolean.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Float.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
GroupState state = new GroupState();
state.setUpdateRate((Integer) result[0]);
state.setActive((Boolean) result[1]);
state.setName(((JIString) ((JIPointer) result[2]).getReferent()).getString());
state.setTimeBias((Integer) result[3]);
state.setPercentDeadband((Float) result[4]);
state.setLocaleId((Integer) result[5]);
state.setClientHandle((Integer) result[6]);
state.setServerHandle((Integer) result[7]);
return state;
}
示例3: setState
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public Integer setState(GroupState state) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsPointer(new JIPointer(state.getUpdateRate()), JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
if (state.isActive() != null)
callObject.addInParamAsPointer(new JIPointer(Integer.valueOf(state.isActive().booleanValue() ? 1 : 0)), JIFlags.FLAG_NULL);
else
callObject.addInParamAsPointer(new JIPointer(null), JIFlags.FLAG_NULL);
callObject.addInParamAsPointer(new JIPointer(state.getTimeBias()), JIFlags.FLAG_NULL);
callObject.addInParamAsPointer(new JIPointer(state.getPercentDeadband()), JIFlags.FLAG_NULL);
callObject.addInParamAsPointer(new JIPointer(state.getLocaleId()), JIFlags.FLAG_NULL);
callObject.addInParamAsPointer(new JIPointer(state.getClientHandle()), JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
return (Integer) result[0];
}
示例4: getSimpleStruct
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public void getSimpleStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(12); //obtained from the IDL or TypeLib. //
Object results[];
JIStruct struct = new JIStruct();
struct.addMember(Integer.class);
struct.addMember(Double.class);
struct.addMember(Float.class);
callObject.addOutParamAsObject(new JIPointer(struct), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(results[0]);
}
示例5: getEmptyStruct
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public static JIStruct getEmptyStruct() throws JIException
{
JIStruct struct = new JIStruct();
struct.addMember(new FileTime().getStruct()); //ftStartTime
struct.addMember(new FileTime().getStruct()); //ftCurrentTime
struct.addMember(new FileTime().getStruct()); //ftLastUpdateTime
struct.addMember(Short.class); //dwServerState
struct.addMember(Integer.class); //dwGroupCount
struct.addMember(Integer.class); //dwBandWidth
struct.addMember(Short.class); //wMajorVersion
struct.addMember(Short.class); //wMinorVersion
struct.addMember(Short.class); //wBuildNumber
struct.addMember(Short.class); //wReserved
struct.addMember(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR))); //szVendorInfo
return struct;
}
示例6: next
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public int next ( final List<UUID> list, final int num ) throws JIException
{
if ( num <= 0 )
{
return 0;
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 0 );
callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIArray ( UUID.class, null, 1, true, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
UUID[] resultData = (UUID[]) ( (JIArray)result[0] ).getArrayInstance ();
Integer cnt = (Integer)result[1];
for ( int i = 0; i < cnt; i++ )
{
list.add ( resultData[i] );
}
return cnt;
}
示例7: browseOPCItemIDs
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public IEnumString browseOPCItemIDs(short browseType, String filterCriteria, short dataTypeFilter, int accessRightsFilter) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(2);
callObject.addInParamAsShort(browseType, JIFlags.FLAG_NULL);
callObject.addInParamAsString(filterCriteria, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
callObject.addInParamAsShort((short) dataTypeFilter, JIFlags.FLAG_NULL);
callObject.addInParamAsInt(accessRightsFilter, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);
Object result[];
try {
result = comObject.call(callObject);
} catch (JIException ex) {
if (ex.getErrorCode() == 1 /*S_FALSE*/) {
result = callObject.getResultsInCaseOfException();
} else {
throw ex;
}
}
return new IEnumString(JIObjectFactory.narrowObject((IJIComObject) result[0]));
}
示例8: GetStruct
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public void GetStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(10); //obtained from the IDL or TypeLib. //
Object results[];
// change the struct to have the array as the last item
JIStruct struct = new JIStruct();
JIArray longArray = new JIArray(Integer.class, new int[]{50},1,false);
struct.addMember(Integer.class);
struct.addMember(Float.class);
struct.addMember(longArray);
callObject.addOutParamAsObject(new JIPointer(struct), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(results[0]);
}
示例9: queryAvailableLocaleIDs
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public int[] queryAvailableLocaleIDs() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCCommon_QueryAvailableLocaleIDs);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
Integer count = (Integer) result[0];
if (count == null)
throw new NullPointerException("Count is null");
int[] availLocales = new int[count];
Integer[] returned = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
for (int i = 0; i < count; i++)
availLocales[i] = returned[i];
return availLocales;
}
示例10: getEmptyStruct
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public static JIStruct getEmptyStruct() throws JIException
{
JIStruct struct = new JIStruct();
struct.addMember(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));//szAccessPath
struct.addMember(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));//szItemID
struct.addMember(Boolean.class);//bActive
struct.addMember(Integer.class);//hClient
struct.addMember(Integer.class);//hServer
struct.addMember(Integer.class);//dwAccessRights
struct.addMember(Integer.class);//dwBlobSize
struct.addMember(new JIPointer(new JIArray(Byte.class, null, 1, true, false))); //pBlob
struct.addMember(Short.class);//vtRequestedDataType
struct.addMember(Short.class);//vtCanonicalDataType
struct.addMember(Integer.class);//dwEUType
struct.addMember(JIVariant.class);//vEUInfo
return struct;
}
示例11: removeItems
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public Map<Integer, Integer> removeItems(Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(2);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
Object[] result;
try {
result = comObject.call(callObject);
} catch (JIException ex) {
if (ex.getErrorCode() == 1 /*S_FALSE*/) {
result = callObject.getResultsInCaseOfException();
} else {
throw ex;
}
}
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < serverHandles.length; i++) {
map.put(serverHandles[i], errorCodes[i]);
}
return map;
}
示例12: GetSimpleArrayStruct
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public void GetSimpleArrayStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(19); //obtained from the IDL or TypeLib. //
Object results[];
JIStruct simpleStruct = new JIStruct();
simpleStruct.addMember(Integer.class);
simpleStruct.addMember(Double.class);
simpleStruct.addMember(Float.class);
JIStruct simpleArrayStruct = new JIStruct();
simpleArrayStruct.addMember(Integer.class);
simpleArrayStruct.addMember(Double.class);
simpleArrayStruct.addMember(JIUnsignedShort.class);
JIArray structArray = new JIArray(simpleStruct, null, 1, true);
simpleArrayStruct.addMember(new JIPointer(structArray));
callObject.addOutParamAsObject(new JIPointer(simpleArrayStruct), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(results[0]);
}
示例13: getTCharArray
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public void getTCharArray()
throws JIException, InterruptedException, UnknownHostException {
System.gc();
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(6);
Object results[];
callObject.addOutParamAsObject(new JIArray(Byte.class, new int[]{50},1,false), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
JIArray arrayOfResults = (JIArray)results[0];
Byte[] arrayOfBytes = (Byte[]) arrayOfResults.getArrayInstance();
int length = 50;
for (int i = 0; i < length; i++) {
System.out.println(arrayOfBytes[i].byteValue());
}
}
示例14: getNames
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public Object[] getNames(int memberId, int maxNames) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
//for experiment only
// JIArray arry = new JIArray(new Integer[]{new Integer(100),new Integer(200)},true);
// JIStruct struct = new JIStruct();
// struct.addMember(Short.valueOf((short)86));
// struct.addMember(arry);
// callObject.addInParamAsStruct(struct,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(memberId,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(maxNames,JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIArray(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),null,1,true,true),JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
return comObject.call(callObject);
}
示例15: getLibAttr
import org.jinterop.dcom.core.JIFlags; //导入依赖的package包/类
public void getLibAttr() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
JIStruct tlibattr = new JIStruct();
tlibattr.addMember(UUID.class);
tlibattr.addMember(Integer.class);
tlibattr.addMember(Integer.class);
tlibattr.addMember(Short.class);
tlibattr.addMember(Short.class);
tlibattr.addMember(Short.class);
callObject.addOutParamAsObject(new JIPointer(tlibattr),JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);//CLEANUPSTORAGE
Object[] result = comObject.call(callObject);
int i = 0;
}