本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.getHRESULT方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.getHRESULT方法的具體用法?Java JICallBuilder.getHRESULT怎麽用?Java JICallBuilder.getHRESULT使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.getHRESULT方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addGroup
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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: 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;
}
示例3: 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();
}
示例4: getGroupByName
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJIComObject getGroupByName(String name, String iid) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCServer_GetGroupByName);
callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
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 JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
示例5: getStatus
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public OPCSERVERSTATUS getStatus() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCServer_GetStatus);
callObject.addOutParamAsObject(new JIPointer(OPCSERVERSTATUS.getEmptyStruct()), JIFlags.FLAG_NULL); // out param ppServerStatus
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return new OPCSERVERSTATUS((JIStruct) ((JIPointer) result[0]).getReferent());
}
示例6: removeGroup
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void removeGroup(int groupHandle, boolean force) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCServer_RemoveGroup);
callObject.addInParamAsInt(groupHandle, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
callObject.addInParamAsBoolean(force, JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
}
示例7: setLocaleID
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void setLocaleID(int lcid) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCCommon_SetLocaleID);
callObject.addInParamAsInt(lcid, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
}
示例8: getLocaleID
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int getLocaleID() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCCommon_GetLocaleID);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return (Integer) 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: setClientName
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void setClientName(String name) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCCommon_SetClientName);
callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
}
示例11: queryAvailableProperties
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ItemPropertyDescription[] queryAvailableProperties(String itemId) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsString(itemId, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR), null, 1, true)), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Short.class, null, 1, true)), JIFlags.FLAG_NULL);
Object[] comResult = comObject.call(callObject);
if (callObject.isError()) {
throw new JIException(callObject.getHRESULT());
}
Integer count = (Integer) comResult[0];
if (count == null) {
throw new NullPointerException("Count is null");
}
Integer[] ids = (Integer[]) ((JIArray) ((JIPointer) comResult[1]).getReferent()).getArrayInstance();
JIString[] descriptions = (JIString[]) ((JIArray) ((JIPointer) comResult[2]).getReferent()).getArrayInstance();
Short[] variableTypes = (Short[]) ((JIArray) ((JIPointer) comResult[3]).getReferent()).getArrayInstance();
ItemPropertyDescription[] properties = new ItemPropertyDescription[count];
for (int i = 0; i < count; i++) {
properties[i] = new ItemPropertyDescription(ids[i], descriptions[i].getString(), variableTypes[i]);
}
return properties;
}
示例12: getIDsOfNames
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int getIDsOfNames(String apiName) throws JIException
{
if (apiName == null || apiName.trim().equals(""))
{
throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_DISP_INCORRECT_VALUE_FOR_GETIDNAMES));
}
Map innerMap = ((Map)cacheOfDispIds.get(apiName));
if (innerMap != null)
{
Integer dispId = (Integer)innerMap.get(apiName);
return dispId.intValue();
}
JICallBuilder obj = new JICallBuilder(true);
obj.setOpnum(2); //size of the array //1st is the num elements and second is the actual values
JIString name = new JIString(apiName.trim(),JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
JIArray array = new JIArray(new JIPointer[]{new JIPointer(name)},true);
obj.addInParamAsUUID(UUID.NIL_UUID,JIFlags.FLAG_NULL);
obj.addInParamAsArray(array,JIFlags.FLAG_NULL);
obj.addInParamAsInt(1,JIFlags.FLAG_NULL);
obj.addInParamAsInt(0x800,JIFlags.FLAG_NULL);
obj.addOutParamAsObject(new JIArray(Integer.class,null,1,true),JIFlags.FLAG_NULL);
Object[] result = comObject.call(obj);
if (result == null && obj.isError())
{
throw new JIException(obj.getHRESULT());
}
innerMap = new HashMap();
innerMap.put(apiName,((Object[])((JIArray)result[0]).getArrayInstance())[0]);
cacheOfDispIds.put(apiName,innerMap);
//first will be the length , and the next will be the actual value.
return ((Integer)((Object[])((JIArray)result[0]).getArrayInstance())[0]).intValue();//will get the dispatch ID.
}