本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder類的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder類的具體用法?Java JICallBuilder怎麽用?Java JICallBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JICallBuilder類屬於org.jinterop.dcom.core包,在下文中一共展示了JICallBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLibAttr
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的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;
}
示例2: 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());
}
}
示例3: 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]));
}
示例4: getSimpleStructArray
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的package包/類
public void getSimpleStructArray(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(13); //obtained from the IDL or TypeLib. //
Object results[];
callObject.addOutParamAsType(JIUnsignedShort.class, JIFlags.FLAG_NULL);
JIStruct struct = new JIStruct();
struct.addMember(Integer.class);
struct.addMember(Double.class);
struct.addMember(Float.class);
JIArray DataArray = new JIArray(struct, null, 1, true);
callObject.addOutParamAsObject(new JIPointer(DataArray), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(((JIUnsignedShort)results[0]).getValue());
}
示例5: 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]));
}
示例6: queryAvailableLocaleIDs
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的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;
}
示例7: performOp
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的package包/類
public void performOp() throws JIException, InterruptedException
{
JICallBuilder callObject = new JICallBuilder (true);
callObject.setOpnum ( 0 );
callObject.addInParamAsString("",JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
callObject.addInParamAsInt(0xFFFFFFFF, JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( 1000,JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( 1234,JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer(new Integer(0)), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer(new Float(0.0)),JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL );
callObject.addInParamAsUUID( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL );
Object[] result = opcServer.call ( callObject );
JISession.destroySession(unknown.getAssociatedSession());
}
示例8: 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);
}
示例9: setActiveState
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的package包/類
public Map<Integer, Integer> setActiveState(boolean active, Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(3);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsBoolean(active, 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;
}
示例10: getConformantStruct
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的package包/類
public void getConformantStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(14); //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));
callObject.addOutParamAsObject(new JIPointer(struct), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(results[0]);
}
示例11: 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;
}
示例12: 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;
}
示例13: getClassDetails
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的package包/類
/**
* Return details about a serve class
* @param clsId A server class
* @throws JIException
*/
public ClassDetails getClassDetails ( final JIClsid clsId ) throws JIException
{
if ( clsId == null )
{
return null;
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsUUID ( clsId.getCLSID (), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
ClassDetails cd = new ClassDetails ();
cd.setClsId ( clsId.getCLSID () );
cd.setProgId ( ( (JIString) ( (JIPointer)result[0] ).getReferent () ).getString () );
cd.setDescription ( ( (JIString) ( (JIPointer)result[1] ).getReferent () ).getString () );
return cd;
}
示例14: setState
import org.jinterop.dcom.core.JICallBuilder; //導入依賴的package包/類
/**
* Set the group state Leaving any of the parameters <code>null</code> will keep the current value untouched.
*
* @param requestedUpdateRate
* the requested update rate
* @param active
* Flag if the group is active or not
* @param timeBias
* The time bias
* @param percentDeadband
* the deadband percent
* @param localeID
* the locale ID
* @param clientHandle
* the client handle
* @return the granted update rate
* @throws JIException
*/
public int setState ( final Integer requestedUpdateRate, final Boolean active, final Integer timeBias, final Float percentDeadband, final Integer localeID, final Integer clientHandle ) throws JIException
{
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsPointer ( new JIPointer ( requestedUpdateRate ), JIFlags.FLAG_NULL );
if ( active != null )
{
callObject.addInParamAsPointer ( new JIPointer ( Integer.valueOf ( active.booleanValue () ? 1 : 0 ) ), JIFlags.FLAG_NULL );
}
else
{
callObject.addInParamAsPointer ( new JIPointer ( null ), JIFlags.FLAG_NULL );
}
callObject.addInParamAsPointer ( new JIPointer ( timeBias ), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer ( percentDeadband ), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer ( localeID ), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer ( clientHandle ), JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
final Object[] result = getCOMObject ().call ( callObject );
return (Integer)result[0];
}
示例15: 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);
}