Examples of callMethodA()


Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

                new JIString("%comspec% /c " + cmd)
            };

            // ref: http://stackoverflow.com/questions/6781340/how-to-call-a-remote-bat-file-using-jinterop

            JIVariant results[] = shell.callMethodA("Exec", scriptArgs);
            final IJIDispatch wbemObjectSet_dispatch =
                    (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());

            JIVariant stdOutJIVariant = wbemObjectSet_dispatch.get(outputStream);
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

            // Read all from stdOut
            StringBuilder sb = new StringBuilder();

            while (!((JIVariant) stdOut.get("AtEndOfStream")).getObjectAsBoolean()) {
                sb.append(stdOut.callMethodA("ReadAll").getObjectAsString().getString());
            }

            return sb.toString();
        }
        catch (NoClassDefFoundError err) {
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

    private void setCount() throws WindowsException {
        try {
            JIVariant[] results = dispatch.callMethodA("ConnectServer", crazyLongMicrosoftArgs);
            IJIDispatch wbemServices_dispatch = (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());
            JIVariant[] results2 = wbemServices_dispatch.callMethodA("InstancesOf", new Object[]{new JIString("Win32_Process"), new Integer(0), JIVariant.OPTIONAL_PARAM()});
            IJIDispatch wbemObjectSet_dispatch = (IJIDispatch) JIObjectFactory.narrowObject((results2[0]).getObjectAsComObject());
            variant = wbemObjectSet_dispatch.get("_NewEnum");
            JIVariant Count = wbemObjectSet_dispatch.get("Count");
            count = Count.getObjectAsInt();
        }
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

                Object[] values = enumVARIANT.next(1);
                JIArray array = (JIArray) values[0];
                Object[] arrayObj = (Object[]) array.getArrayInstance();
                for (int j = 0; j < arrayObj.length; j++) {
                    IJIDispatch wbemObject_dispatch = (IJIDispatch) JIObjectFactory.narrowObject(((JIVariant) arrayObj[j]).getObjectAsComObject());
                    JIVariant variant2 = (JIVariant) (wbemObject_dispatch.callMethodA("GetObjectText_", new Object[]{new Integer(1)}))[0];

                    // normally arrayObj.length is 1
                    if (j == 0)
                        processInfo[i] = variant2.getObjectAsString().getString();
                }
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

            IJIComObject unknown = comStub.createInstance();
            IJIComObject wbemLocatorObj = unknown.queryInterface(WMI_CLSID);
            IJIDispatch wbemLocatorDispatch =  (IJIDispatch) JIObjectFactory.narrowObject(wbemLocatorObj.queryInterface(IJIDispatch.IID));

            // Call WbemScripting.SWbemLocator.ConnectServer method,obtain SWbemServices object
            JIVariant[] results = wbemLocatorDispatch.callMethodA("ConnectServer", new Object[]{
                    JIVariant.OPTIONAL_PARAM(),
                    (namespace == null) ? JIVariant.OPTIONAL_PARAM() : new JIString(namespace)
                    , JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(),
                    (locale == null) ? JIVariant.OPTIONAL_PARAM() : new JIString(locale),
                    (authority == null) ? JIVariant.OPTIONAL_PARAM() : new JIString(authority),
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

                new JIString("%comspec% /c " + cmd)
            };

            // ref: http://stackoverflow.com/questions/6781340/how-to-call-a-remote-bat-file-using-jinterop

            JIVariant results[] = shell.callMethodA("Exec", scriptArgs);
            final IJIDispatch wbemObjectSet_dispatch =
                    (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());

            JIVariant stdOutJIVariant = wbemObjectSet_dispatch.get("StdOut");
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

            // Read all from stdOut
            StringBuilder sb = new StringBuilder();

            while (!((JIVariant) stdOut.get("AtEndOfStream")).getObjectAsBoolean()) {
                sb.append(stdOut.callMethodA("ReadAll").getObjectAsString().getString());
            }

            return sb.toString();
        }
        catch (Exception e) {
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

    private void setCount() throws WindowsException {
        try {
            JIVariant[] results = dispatch.callMethodA("ConnectServer", crazyLongMicrosoftArgs);
            IJIDispatch wbemServices_dispatch = (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());
            JIVariant[] results2 = wbemServices_dispatch.callMethodA("InstancesOf", new Object[]{new JIString("Win32_Process"), new Integer(0), JIVariant.OPTIONAL_PARAM()});
            IJIDispatch wbemObjectSet_dispatch = (IJIDispatch) JIObjectFactory.narrowObject((results2[0]).getObjectAsComObject());
            variant = wbemObjectSet_dispatch.get("_NewEnum");
            JIVariant Count = wbemObjectSet_dispatch.get("Count");
            count = Count.getObjectAsInt();
        }
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

                Object[] values = enumVARIANT.next(1);
                JIArray array = (JIArray) values[0];
                Object[] arrayObj = (Object[]) array.getArrayInstance();
                for (int j = 0; j < arrayObj.length; j++) {
                    IJIDispatch wbemObject_dispatch = (IJIDispatch) JIObjectFactory.narrowObject(((JIVariant) arrayObj[j]).getObjectAsComObject());
                    JIVariant variant2 = (JIVariant) (wbemObject_dispatch.callMethodA("GetObjectText_", new Object[]{new Integer(1)}))[0];

                    // normally arrayObj.length is 1
                    if (j == 0)
                        processInfo[i] = variant2.getObjectAsString().getString();
                }
View Full Code Here

Examples of org.jinterop.dcom.impls.automation.IJIDispatch.callMethodA()

                new JIString("%comspec% /c " + cmd)
            };

            // ref: http://stackoverflow.com/questions/6781340/how-to-call-a-remote-bat-file-using-jinterop

            JIVariant results[] = shell.callMethodA("Exec", scriptArgs);
            final IJIDispatch wbemObjectSet_dispatch =
                    (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());

            JIVariant stdOutJIVariant = wbemObjectSet_dispatch.get(outputStream);
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.