use of com.sun.jna.platform.win32.OaIdl.MEMBERID in project jna by java-native-access.
the class TypeInfoUtil method GetDllEntry.
/**
* Gets the dll entry.
*
* @param memid
* the memid
* @param invKind
* the inv kind
* @return the dll entry
*/
public DllEntry GetDllEntry(MEMBERID memid, INVOKEKIND invKind) {
BSTRByReference pBstrDllName = new BSTRByReference();
BSTRByReference pBstrName = new BSTRByReference();
WORDByReference pwOrdinal = new WORDByReference();
HRESULT hr = this.typeInfo.GetDllEntry(memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
COMUtils.checkRC(hr);
OLEAUTO.SysFreeString(pBstrDllName.getValue());
OLEAUTO.SysFreeString(pBstrName.getValue());
return new DllEntry(pBstrDllName.getString(), pBstrName.getString(), pwOrdinal.getValue().intValue());
}
use of com.sun.jna.platform.win32.OaIdl.MEMBERID in project jna by java-native-access.
the class TypeLibUtil method FindName.
/**
* Find name.
*
* @param name
* the name
* @param hashVal
* the hash val or 0 if unknown
* @param maxResult
* maximum number of items to search
* @return the find name
*/
public FindName FindName(String name, int hashVal, short maxResult) {
Pointer p = Ole32.INSTANCE.CoTaskMemAlloc((name.length() + 1L) * Native.WCHAR_SIZE);
WTypes.LPOLESTR olestr = new WTypes.LPOLESTR(p);
olestr.setValue(name);
ULONG lHashVal = new ULONG(hashVal);
USHORTByReference pcFound = new USHORTByReference(maxResult);
Pointer[] ppTInfo = new Pointer[maxResult];
MEMBERID[] rgMemId = new MEMBERID[maxResult];
HRESULT hr = this.typelib.FindName(olestr, lHashVal, ppTInfo, rgMemId, pcFound);
COMUtils.checkRC(hr);
FindName findName = new FindName(olestr.getValue(), ppTInfo, rgMemId, pcFound.getValue().shortValue());
Ole32.INSTANCE.CoTaskMemFree(p);
return findName;
}
use of com.sun.jna.platform.win32.OaIdl.MEMBERID in project jna by java-native-access.
the class TypeInfoUtil method getDocumentation.
/**
* Gets the documentation.
*
* @param memid
* the memid
* @return the documentation
*/
public TypeInfoDoc getDocumentation(MEMBERID memid) {
BSTRByReference pBstrName = new BSTRByReference();
BSTRByReference pBstrDocString = new BSTRByReference();
DWORDByReference pdwHelpContext = new DWORDByReference();
BSTRByReference pBstrHelpFile = new BSTRByReference();
HRESULT hr = this.typeInfo.GetDocumentation(memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
COMUtils.checkRC(hr);
TypeInfoDoc TypeInfoDoc = new TypeInfoDoc(pBstrName.getString(), pBstrDocString.getString(), pdwHelpContext.getValue().intValue(), pBstrHelpFile.getString());
OLEAUTO.SysFreeString(pBstrName.getValue());
OLEAUTO.SysFreeString(pBstrDocString.getValue());
OLEAUTO.SysFreeString(pBstrHelpFile.getValue());
return TypeInfoDoc;
}
use of com.sun.jna.platform.win32.OaIdl.MEMBERID in project jna by java-native-access.
the class TypeInfoUtil method GetMops.
/**
* Gets the mops.
*
* @param memid
* the memid
* @return the string
*/
public String GetMops(MEMBERID memid) {
BSTRByReference pBstrMops = new BSTRByReference();
HRESULT hr = this.typeInfo.GetMops(memid, pBstrMops);
COMUtils.checkRC(hr);
return pBstrMops.getString();
}
use of com.sun.jna.platform.win32.OaIdl.MEMBERID in project jna by java-native-access.
the class TypeInfoUtil method Invoke.
/**
* Invoke.
*
* @param pvInstance
* the pv instance
* @param memid
* the memid
* @param wFlags
* the w flags
* @param pDispParams
* the disp params
* @return the invoke
*/
public Invoke Invoke(PVOID pvInstance, MEMBERID memid, WORD wFlags, DISPPARAMS.ByReference pDispParams) {
VARIANT.ByReference pVarResult = new VARIANT.ByReference();
EXCEPINFO.ByReference pExcepInfo = new EXCEPINFO.ByReference();
UINTByReference puArgErr = new UINTByReference();
HRESULT hr = this.typeInfo.Invoke(pvInstance, memid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
COMUtils.checkRC(hr);
return new Invoke(pVarResult, pExcepInfo, puArgErr.getValue().intValue());
}
Aggregations