本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.addOutParamAsObject方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.addOutParamAsObject方法的具體用法?Java JICallBuilder.addOutParamAsObject怎麽用?Java JICallBuilder.addOutParamAsObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.addOutParamAsObject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getState
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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;
}
示例2: releaseItemHandles
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, Void> releaseItemHandles(Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles), 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();
ResultTable<Integer, Void> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], null, errorCodes[i]);
}
return resultTable;
}
示例3: getDllEntry
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public Object[] getDllEntry(int memberId, int invKind) throws JIException
{
if (invKind != InvokeKind.INVOKE_FUNC.intValue() && invKind != InvokeKind.INVOKE_PROPERTYGET.intValue()
&& invKind != InvokeKind.INVOKE_PROPERTYPUTREF.intValue() && invKind != InvokeKind.INVOKE_PROPERTYPUT.intValue())
{
throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.E_INVALIDARG));
}
JICallBuilder callObject = new JICallBuilder(true);
callObject.addInParamAsInt(memberId,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(invKind,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(1,JIFlags.FLAG_NULL);//refPtrFlags , as per the oaidl.idl...
callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(Short.class,JIFlags.FLAG_NULL);
callObject.setOpnum(10);
return comObject.call(callObject);
}
示例4: 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;
}
示例5: getConformantIntArray
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void getConformantIntArray()
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(8);
Object results[];
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
JIArray arrayOfResults = (JIArray)((JIPointer)results[1]).getReferent();
Integer[] arrayOfIntegers = (Integer[]) arrayOfResults.getArrayInstance();
int length = ((Integer)results[0]).intValue();
for (int i = 0; i < length; i++) {
System.out.println(arrayOfIntegers[i].intValue());
}
}
示例6: GetStructStruct
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void GetStructStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(17); //obtained from the IDL or TypeLib. //
Object results[];
JIStruct struct = new JIStruct();
struct.addMember(Integer.class);
struct.addMember(Double.class);
struct.addMember(JIUnsignedShort.class);
JIArray longArray = new JIArray(Integer.class, null, 1, true);
struct.addMember(new JIPointer(longArray));
JIStruct StructStruct = new JIStruct();
StructStruct.addMember(Integer.class);
StructStruct.addMember(Double.class);
StructStruct.addMember(struct);
callObject.addOutParamAsObject(new JIPointer(StructStruct), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(results[0]);
}
示例7: getErrorString
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public String getErrorString(long errorCode, int locale) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCServer_GetErrorString);
callObject.addInParamAsInt((int) errorCode, JIFlags.FLAG_NULL);
callObject.addInParamAsInt(locale, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), JIFlags.FLAG_NULL); // out param ppString
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return ((JIString) ((JIPointer) result[0]).getReferent()).getString();
}
示例8: Clone
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJIComObject Clone() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(3);
callObject.addOutParamAsObject(IJIComObject.class, JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
return (IJIComObject) result[0];
}
示例9: getErrorString
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public String getErrorString(long errorCode) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCCommon_GetErrorString);
callObject.addInParamAsInt((int) errorCode, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); // out param ppString
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return ((JIString) ((JIPointer) result[0]).getReferent()).getString();
}
示例10: validate
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public KeyedResultSet<OPCITEMDEF, OPCITEMRESULT> validate ( final OPCITEMDEF... items ) throws JIException
{
if ( items.length == 0 )
{
return new KeyedResultSet<OPCITEMDEF, OPCITEMRESULT> ();
}
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
final JIStruct struct[] = new JIStruct[items.length];
for ( int i = 0; i < items.length; i++ )
{
struct[i] = items[i].toStruct ();
}
final JIArray itemArray = new JIArray ( struct, true );
callObject.addInParamAsInt ( items.length, JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( itemArray, JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); // don't update blobs
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( OPCITEMRESULT.getStruct (), null, 1, 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 JIStruct[] results = (JIStruct[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance ();
final KeyedResultSet<OPCITEMDEF, OPCITEMRESULT> resultList = new KeyedResultSet<OPCITEMDEF, OPCITEMRESULT> ( items.length );
for ( int i = 0; i < items.length; i++ )
{
final OPCITEMRESULT itemResult = OPCITEMRESULT.fromStruct ( results[i] );
final KeyedResult<OPCITEMDEF, OPCITEMRESULT> resultEntry = new KeyedResult<OPCITEMDEF, OPCITEMRESULT> ( items[i], itemResult, errorCodes[i] );
resultList.add ( resultEntry );
}
return resultList;
}
示例11: 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;
}
示例12: 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;
}
示例13: getItemID
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
/**
* Get the complete item id from an item at the local position.
*
* Browsing a hierarchical namespace the browse method will return items based on the
* local level in the namespace. So actually only the last part of the item ID hierarchy
* is returned. In order to convert this to the full item ID one can use this method. It
* will only work if the browser is still at the position in question.
*
* @param item the local item
* @return the complete item ID
* @throws JIException
*/
public String getItemID ( final String item ) throws JIException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 3 );
callObject.addInParamAsString ( item, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL );
Object[] result = getCOMObject ().call ( callObject );
return ( (JIString) ( (JIPointer)result[0] ).getReferent () ).getString ();
}
示例14: next
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJIComObject[] next(int celt) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(celt, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIArray(new JIPointer(IJIComObject.class, true), 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");
JIPointer[] pointers = (JIPointer[])((JIArray)(result[0])).getArrayInstance();
IJIComObject[] returned = new IJIComObject[pointers.length];
for (int i =0; i < pointers.length; i++)
returned[i] = (IJIComObject) pointers[i].getReferent();
// IJIComObject[] returned = (IJIComObject[]) ((JIArray) (result[0])).getArrayInstance();
return returned;
}
示例15: getConnectionInterface
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public String getConnectionInterface() throws JIException
{
JICallBuilder callObj = new JICallBuilder(true);
callObj.setOpnum(0);
callObj.addOutParamAsObject(new JIPointer(UUID.class, true), JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObj);
return ((UUID) ((JIPointer) result[0]).getReferent()).toString();
}