當前位置: 首頁>>代碼示例>>Java>>正文


Java JICallBuilder.addInParamAsInt方法代碼示例

本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.addInParamAsInt方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.addInParamAsInt方法的具體用法?Java JICallBuilder.addInParamAsInt怎麽用?Java JICallBuilder.addInParamAsInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jinterop.dcom.core.JICallBuilder的用法示例。


在下文中一共展示了JICallBuilder.addInParamAsInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setConformantIntArray

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void setConformantIntArray()
    throws JIException, InterruptedException, UnknownHostException {
    System.gc();
    JICallBuilder callObject = new JICallBuilder( true);
    callObject.setOpnum(9);
    Object results[];
    int i = 4;
    Integer[] intAry = new Integer[i];
    for(int j = 0; j < i; j++) {
        intAry[j] = new Integer(j);
    }
    JIArray ary = new JIArray(intAry, true);
    callObject.addInParamAsInt(i, JIFlags.FLAG_NULL);
    callObject.addInParamAsArray(ary, JIFlags.FLAG_NULL);
    results = comObject.call(callObject);
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:17,代碼來源:SampleTestServer.java

示例2: setActiveState

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultSet<Integer> setActiveState ( final boolean state, final Integer... items ) throws JIException
{
    if ( items.length == 0 )
    {
        return new ResultSet<Integer> ();
    }

    final JICallBuilder callObject = new JICallBuilder ( true );
    callObject.setOpnum ( 3 );

    callObject.addInParamAsInt ( items.length, JIFlags.FLAG_NULL );
    callObject.addInParamAsArray ( new JIArray ( items, true ), JIFlags.FLAG_NULL );
    callObject.addInParamAsInt ( state ? 1 : 0, JIFlags.FLAG_NULL );
    callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );

    final Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );

    final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
    final ResultSet<Integer> results = new ResultSet<Integer> ( items.length );
    for ( int i = 0; i < items.length; i++ )
    {
        results.add ( new Result<Integer> ( items[i], errorCodes[i] ) );
    }
    return results;
}
 
開發者ID:luoyan35714,項目名稱:OPC_Client,代碼行數:26,代碼來源:OPCItemMgt.java

示例3: next

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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;
}
 
開發者ID:luoyan35714,項目名稱:OPC_Client,代碼行數:27,代碼來源:EnumGUID.java

示例4: removeItems

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:26,代碼來源:IOPCItemMgt.java

示例5: readRaw

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ReadResult<OPCHDA_ITEM> readRaw(OPCHDA_TIME startTime, OPCHDA_TIME endTime, int numValues, boolean withBounds, Integer[] serverHandles) throws JIException {
        JICallBuilder callObject = new JICallBuilder(true);
        callObject.setOpnum(0);
//        callObject.addInParamAsPointer(new JIPointer(startTime.getStruct(), true), JIFlags.FLAG_NULL);
//        callObject.addInParamAsPointer(new JIPointer(endTime.getStruct(), true), JIFlags.FLAG_NULL);
        callObject.addInParamAsStruct(startTime.getStruct(), JIFlags.FLAG_NULL);
        callObject.addInParamAsStruct(endTime.getStruct(), JIFlags.FLAG_NULL);
        callObject.addInParamAsInt(numValues, JIFlags.FLAG_NULL);
        callObject.addInParamAsBoolean(withBounds, JIFlags.FLAG_NULL);
        callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
        callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
        callObject.addOutParamAsObject(new OPCHDA_TIME().getStruct(), JIFlags.FLAG_NULL);
        callObject.addOutParamAsObject(new OPCHDA_TIME().getStruct(), 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) result[0]));
        endTime = new OPCHDA_TIME(((JIStruct) result[1]));
        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);
    }
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:37,代碼來源:IOPCHDA_SyncRead.java

示例6: readAtTime

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, OPCHDA_ITEM> readAtTime(FileTime[] timeStamps, Integer[] serverHandles) throws JIException {
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(2);

    JIStruct[] timeStampsStruct = new JIStruct[timeStamps.length];
    for (int i = 0; i < timeStamps.length; i++) {
        timeStampsStruct[i] = timeStamps[i].getStruct();
    }

    callObject.addInParamAsInt(timeStamps.length, JIFlags.FLAG_NULL);
    callObject.addInParamAsArray(new JIArray(timeStampsStruct, true), 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(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;
        }
    }
    JIStruct[] items = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
    Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).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 resultTable;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:36,代碼來源:IOPCHDA_SyncRead.java

示例7: getItemHandles

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, Integer> getItemHandles(String[] itemIDs, Integer[] clientHandles) throws JIException {
    if (itemIDs.length != clientHandles.length) {
        throw new IllegalArgumentException("Arrays' sizes differ.");
    }
    JIString[] array = new JIString[itemIDs.length];
    for (int i = 0; i < array.length; i++) {
        array[i] = new JIString(itemIDs[i], JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    }
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(3);
    callObject.addInParamAsInt(itemIDs.length, JIFlags.FLAG_NULL);
    callObject.addInParamAsArray(new JIArray(array, true), JIFlags.FLAG_NULL);
    callObject.addInParamAsArray(new JIArray(clientHandles, true), JIFlags.FLAG_NULL);
    callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, 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;
        }
    }
    Integer[] serverHandles = (Integer[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
    Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
    ResultTable<Integer, Integer> resultTable = new ResultTable<>();
    for (int i = 0; i < clientHandles.length; i++) {
        resultTable.put(clientHandles[i], serverHandles[i], errorCodes[i]);
    }
    return resultTable;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:35,代碼來源:IOPCHDA_Server.java

示例8: getTypeInfo

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJITypeInfo getTypeInfo(int index) throws JIException
{
	JICallBuilder callObject = new JICallBuilder(true);
	callObject.setOpnum(1);
	callObject.addInParamAsInt(index,JIFlags.FLAG_NULL);
	callObject.addOutParamAsType(IJIComObject.class,JIFlags.FLAG_NULL);
	Object[] result = comObject.call(callObject);
	return (IJITypeInfo) JIObjectFactory.narrowObject((IJIComObject)result[0]);
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:10,代碼來源:JITypeLibImpl.java

示例9: getTypeInfoType

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int getTypeInfoType(int index) throws JIException
{
	JICallBuilder callObject = new JICallBuilder(true);
	callObject.setOpnum(2);
	callObject.addInParamAsInt(index,JIFlags.FLAG_NULL);
	callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
	Object[] result = comObject.call(callObject);
	return ((Integer)result[0]).intValue();
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:10,代碼來源:JITypeLibImpl.java

示例10: 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 );
}
 
開發者ID:luoyan35714,項目名稱:OPC_Client,代碼行數:10,代碼來源:OPCAsyncIO2.java

示例11: getRefTypeOfImplType

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int getRefTypeOfImplType(int index) throws JIException
{
	JICallBuilder callObject = new JICallBuilder(true);
	callObject.setOpnum(5);
	callObject.addInParamAsInt(index,JIFlags.FLAG_NULL);
	callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
	return ((Integer)(((Object[])comObject.call(callObject))[0])).intValue();
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:9,代碼來源:JITypeInfoImpl.java

示例12: enumClassesOfCategories

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public EnumGUID enumClassesOfCategories ( final UUID[] implemented, final UUID[] required ) throws IllegalArgumentException, UnknownHostException, JIException
{
    // ** CALL
    JICallBuilder callObject = new JICallBuilder ( true );
    callObject.setOpnum ( 0 );

    // ** IN
    callObject.addInParamAsInt ( implemented.length, JIFlags.FLAG_NULL );
    if ( implemented.length == 0 )
    {
        callObject.addInParamAsPointer ( new JIPointer ( null ), JIFlags.FLAG_NULL );
    }
    else
    {
        callObject.addInParamAsArray ( new JIArray ( implemented, true ), JIFlags.FLAG_NULL );
    }

    callObject.addInParamAsInt ( required.length, JIFlags.FLAG_NULL );
    if ( required.length == 0 )
    {
        callObject.addInParamAsPointer ( new JIPointer ( null ), JIFlags.FLAG_NULL );
    }
    else
    {
        callObject.addInParamAsArray ( new JIArray ( required, true ), JIFlags.FLAG_NULL );
    }

    // ** OUT
    callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL );

    // ** RESULT
    Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject );

    return new EnumGUID ( (IJIComObject)result[0] );
}
 
開發者ID:luoyan35714,項目名稱:OPC_Client,代碼行數:36,代碼來源:OPCServerList.java

示例13: lookupItemIDs

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, String> lookupItemIDs(String itemId, int[] propertyIds) throws JIException {
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(2);
    callObject.addInParamAsString(itemId, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsInt(propertyIds.length, JIFlags.FLAG_NULL);
    Integer[] idsArr = new Integer[propertyIds.length];
    for (int i = 0; i < propertyIds.length; i++) {
        idsArr[i] = propertyIds[i];
    }
    callObject.addInParamAsArray(new JIArray(idsArr), JIFlags.FLAG_NULL);
    callObject.addOutParamAsObject(new JIPointer(new JIArray(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), null, 1, true)), JIFlags.FLAG_NULL);
    callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);

    Object[] comResult;
    try {
        comResult = comObject.call(callObject);
    } catch (JIException ex) {
        if (ex.getErrorCode() == 1 /*S_FALSE*/) {
            comResult = callObject.getResultsInCaseOfException();
        } else {
            throw ex;
        }
    }

    JIPointer[] itemIDs = (JIPointer[]) ((JIArray) ((JIPointer) comResult[0]).getReferent()).getArrayInstance();
    Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) comResult[1]).getReferent()).getArrayInstance();
    ResultTable<Integer, String> resultTable = new ResultTable<>();
    for (int i = 0; i < propertyIds.length; i++) {
        resultTable.put(propertyIds[i], ((JIString) itemIDs[i].getReferent()).getString(), errorCodes[i]);
    }
    return resultTable;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:33,代碼來源:IOPCItemProperties.java

示例14: setClientHandles

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultSet<Integer> setClientHandles ( final Integer[] serverHandles, final Integer[] clientHandles ) throws JIException
{
    if ( serverHandles.length != clientHandles.length )
    {
        throw new JIException ( 0, "Array sizes don't match" );
    }
    if ( serverHandles.length == 0 )
    {
        return new ResultSet<Integer> ();
    }

    final JICallBuilder callObject = new JICallBuilder ( true );
    callObject.setOpnum ( 4 );

    callObject.addInParamAsInt ( serverHandles.length, JIFlags.FLAG_NULL );
    callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL );
    callObject.addInParamAsArray ( new JIArray ( clientHandles, true ), JIFlags.FLAG_NULL );
    callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );

    final Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );

    final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
    final ResultSet<Integer> results = new ResultSet<Integer> ( serverHandles.length );
    for ( int i = 0; i < serverHandles.length; i++ )
    {
        results.add ( new Result<Integer> ( serverHandles[i], errorCodes[i] ) );
    }
    return results;
}
 
開發者ID:luoyan35714,項目名稱:OPC_Client,代碼行數:30,代碼來源:OPCItemMgt.java

示例15: getTypeInfo

import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJITypeInfo getTypeInfo(int typeInfo) throws JIException
{
	JICallBuilder obj = new JICallBuilder(true);
	obj.setOpnum(1);
	obj.addInParamAsInt(typeInfo,JIFlags.FLAG_NULL);
	obj.addInParamAsInt(0x400,JIFlags.FLAG_NULL);
	obj.addOutParamAsType(IJIComObject.class,JIFlags.FLAG_NULL);
	//obj.setUpParams(new Object[]{new Integer(typeInfo),new Integer(0x400)},new Object[]{MInterfacePointer.class},JIFlags.FLAG_NULL,JIFlags.FLAG_NULL);
	Object[] result = comObject.call(obj);
	return (IJITypeInfo)JIObjectFactory.narrowObject((IJIComObject)result[0]);
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:12,代碼來源:JIDispatchImpl.java


注:本文中的org.jinterop.dcom.core.JICallBuilder.addInParamAsInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。