本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.setOpnum方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.setOpnum方法的具體用法?Java JICallBuilder.setOpnum怎麽用?Java JICallBuilder.setOpnum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.setOpnum方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setState
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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];
}
示例2: browseOPCItemIDs
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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]));
}
示例3: browseAccessPaths
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IEnumString browseAccessPaths(String itemId) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
callObject.addInParamAsString(itemId, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
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]));
}
示例4: read
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, OPCITEMSTATE> read(short datasource, Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsShort(datasource, JIFlags.FLAG_NULL);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(OPCITEMSTATE.getEmptyStruct(), null, 1, 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;
}
}
JIStruct[] states = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
ResultTable<Integer, OPCITEMSTATE> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], new OPCITEMSTATE(states[i]), errorCodes[i]);
}
return resultTable;
}
示例5: GetStaticStruct
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void GetStaticStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(15); //obtained from the IDL or TypeLib. //
Object results[];
JIStruct varStruct = new JIStruct();
varStruct.addMember(JIUnsignedInteger.class);
varStruct.addMember(Float.class);
varStruct.addMember(Float.class);
varStruct.addMember(JIUnsignedShort.class);
varStruct.addMember(Float.class);
varStruct.addMember(Date.class);
varStruct.addMember(JIUnsignedInteger.class);
JIStruct pointStruct = new JIStruct();
pointStruct.addMember(JIUnsignedInteger.class);
pointStruct.addMember(JIUnsignedInteger.class);
pointStruct.addMember(Byte.class);
JIArray structArray = new JIArray(varStruct, null, 1, true);
pointStruct.addMember(new JIPointer(structArray));
JIArray DataArray = new JIArray(pointStruct, null, 1, true);
callObject.addOutParamAsType(JIUnsignedShort.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(DataArray, false), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(((JIUnsignedShort)results[0]).getValue());
}
示例6: read
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public AsyncResult read ( final int transactionId, final Integer... serverHandles ) throws JIException
{
if ( serverHandles == null || serverHandles.length == 0 )
{
return new AsyncResult ();
}
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 0 );
callObject.addInParamAsInt ( serverHandles.length, JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( transactionId, JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );
final Object[] result = getCOMObject ().call ( callObject );
final Integer cancelId = (Integer)result[0];
final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance ();
final ResultSet<Integer> resultSet = new ResultSet<Integer> ();
for ( int i = 0; i < serverHandles.length; i++ )
{
resultSet.add ( new Result<Integer> ( serverHandles[i], errorCodes[i] ) );
}
return new AsyncResult ( resultSet, cancelId );
}
示例7: advise
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int advise(IJIComObject sink) throws JIException
{
JICallBuilder callObj = new JICallBuilder(true);
callObj.setOpnum(2);
callObj.addInParamAsComObject(sink, JIFlags.FLAG_NULL);
callObj.addOutParamAsType(Integer.class, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
Object[] result = comObject.call(callObj);
return (Integer) result[0];
}
示例8: cancel
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void cancel ( final int cancelId ) throws JIException
{
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 3 );
callObject.addInParamAsInt ( cancelId, JIFlags.FLAG_NULL );
getCOMObject ().call ( callObject );
}
示例9: write
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultSet<WriteRequest> write ( final WriteRequest... requests ) throws JIException
{
if ( requests.length == 0 )
{
return new ResultSet<WriteRequest> ();
}
Integer[] items = new Integer[requests.length];
JIVariant[] values = new JIVariant[requests.length];
for ( int i = 0; i < requests.length; i++ )
{
items[i] = requests[i].getServerHandle ();
values[i] = Helper.fixVariant ( requests[i].getValue () );
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsInt ( requests.length, JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( items, true ), JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( values, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );
Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject );
Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
ResultSet<WriteRequest> results = new ResultSet<WriteRequest> ();
for ( int i = 0; i < requests.length; i++ )
{
results.add ( new Result<WriteRequest> ( requests[i], errorCodes[i] ) );
}
return results;
}
示例10: skip
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void skip(int celt) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsInt(celt, JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
}
示例11: readProcessed
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ReadResult<OPCHDA_ITEM> readProcessed(OPCHDA_TIME startTime, OPCHDA_TIME endTime, FileTime resampleInterval, Integer[] serverHandles, Integer[] aggregates) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsStruct(startTime.getStruct(), JIFlags.FLAG_NULL);
callObject.addInParamAsStruct(endTime.getStruct(), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new OPCHDA_TIME().getStruct(), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new OPCHDA_TIME().getStruct(), JIFlags.FLAG_NULL);
callObject.addInParamAsStruct(resampleInterval.getStruct(), JIFlags.FLAG_NULL);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(aggregates, true), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(new OPCHDA_ITEM().getStruct(), null, 1, 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;
}
}
startTime = new OPCHDA_TIME(((JIStruct) ((JIPointer) result[0]).getReferent()));
endTime = new OPCHDA_TIME(((JIStruct) ((JIPointer) result[1]).getReferent()));
JIStruct[] items = (JIStruct[]) ((JIArray) ((JIPointer) result[2]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[3]).getReferent()).getArrayInstance();
ResultTable<Integer, OPCHDA_ITEM> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], new OPCHDA_ITEM(items[i]), errorCodes[i]);
}
return new ReadResult<>(startTime, endTime, resultTable);
}
示例12: next
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public OPCITEMATTRIBUTES[] next(int celt) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(celt, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(OPCITEMATTRIBUTES.getEmptyStruct(), null, 1, true, true)), JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.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;
}
Integer count = (Integer) result[1];
if (count == null)
throw new NullPointerException("Elements count is null");
JIStruct[] returned = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
OPCITEMATTRIBUTES[] attrs = new OPCITEMATTRIBUTES[count];
for (int i = 0; i < count; i++)
attrs[i] = new OPCITEMATTRIBUTES(returned[i]);
return attrs;
}
示例13: setEnable
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void setEnable ( final boolean state ) throws JIException
{
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 4 );
callObject.addInParamAsInt ( state ? 1 : 0, JIFlags.FLAG_NULL );
getCOMObject ().call ( callObject );
}
示例14: enumConnections
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJIComObject enumConnections() throws JIException
{
JICallBuilder callObj = new JICallBuilder(true);
callObj.setOpnum(4);
callObj.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);//TODO out param is IEnumConnections**
Object[] result = comObject.call(callObj);
return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
示例15: getTypeInfoOfGuid
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJITypeInfo getTypeInfoOfGuid(String uuid) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(3);
callObject.addInParamAsUUID(uuid,JIFlags.FLAG_NULL);
callObject.addOutParamAsType(IJIComObject.class,JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
return (IJITypeInfo) JIObjectFactory.narrowObject((IJIComObject)result[0]);
}