Package com.sun.jna.platform.win32.WTypes

Examples of com.sun.jna.platform.win32.WTypes.VARTYPE.intValue()


        VARIANT variantDest = new VARIANT();

        HRESULT hr = OleAuto.INSTANCE.VariantCopy(variantDest.getPointer(),
                                                  variantSource);

        assertTrue("hr: " + hr.intValue(), hr.intValue() == 0);
    }

    public void testVariantDate() {
        SYSTEMTIME lpSystemTime = new SYSTEMTIME();
        Kernel32.INSTANCE.GetLocalTime(lpSystemTime);
View Full Code Here


        GUID guid = KnownFolders.FOLDERID_Fonts;
        HRESULT hr = Shell32.INSTANCE.SHGetKnownFolderPath(guid, flags, token, outPath);

        Ole32.INSTANCE.CoTaskMemFree(outPath.getValue());

        assertTrue(W32Errors.SUCCEEDED(hr.intValue()));
    }
}
View Full Code Here

        int flags = ShlObj.KNOWN_FOLDER_FLAG.NONE.getFlag();
        PointerByReference outPath = new PointerByReference();
        HANDLE token = null;
        HRESULT hr = Shell32.INSTANCE.SHGetKnownFolderPath(guid, flags, token, outPath);

        if (!W32Errors.SUCCEEDED(hr.intValue()))
        {
            throw new Win32Exception(hr);
        }

        String result = outPath.getValue().getWideString(0);
View Full Code Here

        Native.toString(lpsz));
  }

  public void testCoInitializeEx() {
    HRESULT hr = Ole32.INSTANCE.CoInitializeEx(null, 0);
    assertTrue(W32Errors.SUCCEEDED(hr.intValue())
        || hr.intValue() == W32Errors.RPC_E_CHANGED_MODE);
    if (W32Errors.SUCCEEDED(hr.intValue()))
      Ole32.INSTANCE.CoUninitialize();
  }
View Full Code Here

  }

  public void testCoInitializeEx() {
    HRESULT hr = Ole32.INSTANCE.CoInitializeEx(null, 0);
    assertTrue(W32Errors.SUCCEEDED(hr.intValue())
        || hr.intValue() == W32Errors.RPC_E_CHANGED_MODE);
    if (W32Errors.SUCCEEDED(hr.intValue()))
      Ole32.INSTANCE.CoUninitialize();
  }

  public void testCoCreateInstance() {
View Full Code Here

  public void testCoInitializeEx() {
    HRESULT hr = Ole32.INSTANCE.CoInitializeEx(null, 0);
    assertTrue(W32Errors.SUCCEEDED(hr.intValue())
        || hr.intValue() == W32Errors.RPC_E_CHANGED_MODE);
    if (W32Errors.SUCCEEDED(hr.intValue()))
      Ole32.INSTANCE.CoUninitialize();
  }

  public void testCoCreateInstance() {
    HRESULT hrCI = Ole32.INSTANCE.CoInitializeEx(null, 0);
View Full Code Here

    HRESULT hr = Ole32.INSTANCE.CoCreateInstance(guid, null, // pOuter =
                                  // null, no
                                  // aggregation
        WTypes.CLSCTX_LOCAL_SERVER, riid, pDispatch);
    assertTrue(W32Errors.SUCCEEDED(hr.intValue()));
    assertTrue(!pDispatch.equals(Pointer.NULL));
    // We leak this iUnknown reference because we don't have the JNACOM lib
    // here to wrap the native iUnknown pointer and call iUnknown.release()
    if (W32Errors.SUCCEEDED(hrCI.intValue()))
      Ole32.INSTANCE.CoUninitialize();
View Full Code Here

    public void testVariantClear() {
        VARIANT variant = new VARIANT(new SHORT(33333));
        HRESULT hr = OleAuto.INSTANCE.VariantClear(variant.getPointer());

        assertTrue("hr: " + hr.intValue(), hr.intValue() == 0);
    }

    public void testVariantCopyShort() {
        VARIANT variantSource = new VARIANT(new SHORT(33333));
        VARIANT variantDest = new VARIANT();
View Full Code Here

    public void testVariantClear() {
        VARIANT variant = new VARIANT(new SHORT(33333));
        HRESULT hr = OleAuto.INSTANCE.VariantClear(variant.getPointer());

        assertTrue("hr: " + hr.intValue(), hr.intValue() == 0);
    }

    public void testVariantCopyShort() {
        VARIANT variantSource = new VARIANT(new SHORT(33333));
        VARIANT variantDest = new VARIANT();
View Full Code Here

        //System.out.println(variantSource.toString(true));
        HRESULT hr = OleAuto.INSTANCE.VariantCopy(variantDest.getPointer(),
                                                  variantSource);

        assertTrue("hr: " + hr.intValue(), hr.intValue() == 0);
    }

    public void testVariantCopyBoolean() {
        VARIANT variantSource = new VARIANT(Variant.VARIANT_TRUE);
        VARIANT variantDest = new VARIANT();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.