Package com.sun.jna.ptr

Examples of com.sun.jna.ptr.DoubleByReference


    public void testVariantDate() {
        SYSTEMTIME lpSystemTime = new SYSTEMTIME();
        Kernel32.INSTANCE.GetLocalTime(lpSystemTime);

        DoubleByReference pvtime = new DoubleByReference();
        OleAuto.INSTANCE.SystemTimeToVariantTime(lpSystemTime, pvtime);

        VARIANT variantDate = new VARIANT(new DATE(pvtime.getValue()));
    }
View Full Code Here


    public void testVariantDate() {
        SYSTEMTIME lpSystemTime = new SYSTEMTIME();
        Kernel32.INSTANCE.GetLocalTime(lpSystemTime);

        DoubleByReference pvtime = new DoubleByReference();
        OleAuto.INSTANCE.SystemTimeToVariantTime(lpSystemTime, pvtime);

        VARIANT variantDate = new VARIANT(new DATE(pvtime.getValue()));
    }
View Full Code Here

        FloatByReference fref = new FloatByReference(1f);
        lib.complementFloatByReference(fref);
        assertEquals("Float argument not modified", -1f, fref.getValue(), 0.0);
    }
    public void testDoubleByReference() {
        DoubleByReference dref = new DoubleByReference(1d);
        lib.complementDoubleByReference(dref);
        assertEquals("Int argument not modified", -1d, dref.getValue(), 0.0);
    }
View Full Code Here

          result = lib.wdGetStringScriptResult(scriptResult, message);
          errors.verifyErrorCode(result, "Cannot extract string result");
          throw new WebDriverException(new StringWrapper(lib, message).toString());

        case IeReturnTypes.DOUBLE: // Double
          DoubleByReference doubleVal = new DoubleByReference();
          result = lib.wdGetDoubleScriptResult(scriptResult, doubleVal);
          errors.verifyErrorCode(result, "Cannot extract double result");
          toReturn = doubleVal.getValue();
          break;
         
        case IeReturnTypes.ARRAY: // Array
          IntByReference arrayLength = new IntByReference();
          result = lib.wdGetArrayLengthScriptResult(
View Full Code Here

                        val = new Double(Double.parseDouble((String)val)).doubleValue();
                    } else {
                        throw new RuntimeException("Attempt to pass ineligible value to long: "+val);
                    }
                }
                return new DoubleByReference((Double)val);
            case 'B':
            case 'b':
            case 'c':
            case 'C':
                if ( Number.class.isInstance(val) ){
View Full Code Here

                   
                    long argumentSigAddr = (Long)pSig.send("getArgumentTypeAtIndex:", i);
                    String argumentSignature = new Pointer(argumentSigAddr).getString(0);
                  
                    if ( "fd".indexOf(argumentSignature.substring(0,1)) != -1 ){
                        DoubleByReference ptrRef = new DoubleByReference();
                       
                        msg(invocation, "getArgument:atIndex:", ptrRef.getPointer(), i);
                       
                        args[i-2] = TypeMapper
                                    .getInstance()
                                    .cToJ(
                                        ptrRef.getValue(),
                                        //argPtr.toNative(),
                                        argumentSignature,
                                        TypeMapper.getInstance()
                                );
                    } else {
                        LongByReference ptrRef = new LongByReference();
                       
                        msg(invocation, "getArgument:atIndex:", ptrRef.getPointer(), i);
                      
                        args[i-2] = TypeMapper
                                    .getInstance()
                                    .cToJ(
                                        ptrRef.getValue(),
                                        //argPtr.toNative(),
                                        argumentSignature,
                                        TypeMapper.getInstance()
                                );
                    }
View Full Code Here

        FloatByReference fref = new FloatByReference(1f);
        lib.complementFloatByReference(fref);
        assertEquals("Float argument not modified", -1f, fref.getValue(), 0.0);
    }
    public void testDoubleByReference() {
        DoubleByReference dref = new DoubleByReference(1d);
        lib.complementDoubleByReference(dref);
        assertEquals("Int argument not modified", -1d, dref.getValue(), 0.0);
    }
View Full Code Here

                        val = new Double(Double.parseDouble((String)val)).doubleValue();
                    } else {
                        throw new RuntimeException("Attempt to pass ineligible value to long: "+val);
                    }
                }
                return new DoubleByReference((Double)val);
            case 'B':
            case 'b':
            case 'c':
            case 'C':
                if ( Number.class.isInstance(val) ){
View Full Code Here

TOP

Related Classes of com.sun.jna.ptr.DoubleByReference

Copyright © 2018 www.massapicom. 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.