Search in sources :

Example 6 with MEMBERID

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());
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference) DWORDByReference(com.sun.jna.platform.win32.WinDef.DWORDByReference) WORDByReference(com.sun.jna.platform.win32.WinDef.WORDByReference)

Example 7 with MEMBERID

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;
}
Also used : ULONG(com.sun.jna.platform.win32.WinDef.ULONG) HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) LPOLESTR(com.sun.jna.platform.win32.WTypes.LPOLESTR) MEMBERID(com.sun.jna.platform.win32.OaIdl.MEMBERID) LPOLESTR(com.sun.jna.platform.win32.WTypes.LPOLESTR) USHORTByReference(com.sun.jna.platform.win32.WinDef.USHORTByReference) Pointer(com.sun.jna.Pointer) WTypes(com.sun.jna.platform.win32.WTypes)

Example 8 with MEMBERID

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;
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) DWORDByReference(com.sun.jna.platform.win32.WinDef.DWORDByReference) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference)

Example 9 with MEMBERID

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();
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference)

Example 10 with MEMBERID

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());
}
Also used : UINTByReference(com.sun.jna.platform.win32.WinDef.UINTByReference) HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) EXCEPINFO(com.sun.jna.platform.win32.OaIdl.EXCEPINFO) HREFTYPEByReference(com.sun.jna.platform.win32.OaIdl.HREFTYPEByReference) UINTByReference(com.sun.jna.platform.win32.WinDef.UINTByReference) DWORDByReference(com.sun.jna.platform.win32.WinDef.DWORDByReference) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference) PointerByReference(com.sun.jna.ptr.PointerByReference) WORDByReference(com.sun.jna.platform.win32.WinDef.WORDByReference) IntByReference(com.sun.jna.ptr.IntByReference) VARIANT(com.sun.jna.platform.win32.Variant.VARIANT)

Aggregations

HRESULT (com.sun.jna.platform.win32.WinNT.HRESULT)15 MEMBERID (com.sun.jna.platform.win32.OaIdl.MEMBERID)11 BSTRByReference (com.sun.jna.platform.win32.WTypes.BSTRByReference)7 Test (org.junit.Test)6 DWORDByReference (com.sun.jna.platform.win32.WinDef.DWORDByReference)5 UINT (com.sun.jna.platform.win32.WinDef.UINT)4 PointerByReference (com.sun.jna.ptr.PointerByReference)4 LPOLESTR (com.sun.jna.platform.win32.WTypes.LPOLESTR)3 UINTByReference (com.sun.jna.platform.win32.WinDef.UINTByReference)3 ULONG (com.sun.jna.platform.win32.WinDef.ULONG)3 WORDByReference (com.sun.jna.platform.win32.WinDef.WORDByReference)3 Pointer (com.sun.jna.Pointer)2 TYPEATTR (com.sun.jna.platform.win32.OaIdl.TYPEATTR)2 WTypes (com.sun.jna.platform.win32.WTypes)2 BSTR (com.sun.jna.platform.win32.WTypes.BSTR)2 USHORTByReference (com.sun.jna.platform.win32.WinDef.USHORTByReference)2 Ignore (org.junit.Ignore)2 WString (com.sun.jna.WString)1 TypeInfoDoc (com.sun.jna.platform.win32.COM.TypeInfoUtil.TypeInfoDoc)1 OaIdl (com.sun.jna.platform.win32.OaIdl)1