Package org.jinterop.dcom.core

Examples of org.jinterop.dcom.core.JIString


    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"), Integer.valueOf(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


    // TODO Auto-generated method stub
    JISystem.setAutoRegisteration(true);
    try {
      JXCdoSession jxCdoSession = new JXCdoSession("localhost",
          "localhost", "vikram", "vikram");
      jxCdoSession.Logon(new JIString("vikram_roopchand").Variant,
          new JIString("Password").Variant, new JIVariant(false),
          new JIVariant(true), new JIVariant(false), new JIVariant(
              false), new JIString(
              "PUNAXCHEMBPIN02.enterprise.corp.com" + "\n"
                  + "vikram_roopchand").Variant);
      System.out.println(jxCdoSession.GetCurrentUser());
      System.out.println(jxCdoSession.GetCdoClass());
      jxCdoSession.Logoff();
View Full Code Here

      JXCdoSession jxCdoSession = new JXCdoSession(
          ICredentialBag.machinecred_cdoinstalledhost,
          ICredentialBag.machinecred_domain,
          ICredentialBag.machinecred_username,
          ICredentialBag.machinecred_password);
      jxCdoSession.Logon(new JIString(
          ICredentialBag.logoncred_profilename).Variant,
          new JIString(ICredentialBag.logoncred_password).Variant,
          new JIVariant(false), new JIVariant(true), new JIVariant(
              false), new JIVariant(false), new JIString(
              ICredentialBag.logoncred_profileinfo).Variant);

           // get the info stores
              JXCdoInfoStores ifss = new JXCdoInfoStores(jxCdoSession,jxCdoSession.GetInfoStores());
              int count = ifss.GetCount().getObjectAsInt();
View Full Code Here

      JXCdoSession jxCdoSession = new JXCdoSession(
          ICredentialBag.machinecred_cdoinstalledhost,
          ICredentialBag.machinecred_domain,
          ICredentialBag.machinecred_username,
          ICredentialBag.machinecred_password);
      jxCdoSession.Logon(new JIString(
          ICredentialBag.logoncred_profilename).Variant,
          new JIString(ICredentialBag.logoncred_password).Variant,
          new JIVariant(false), new JIVariant(true), new JIVariant(
              false), new JIVariant(false), new JIString(
              ICredentialBag.logoncred_profileinfo).Variant);
          JXCdoAddressEntry user = new JXCdoAddressEntry(jxCdoSession,jxCdoSession.GetCurrentUser());
      System.out.println("Current user: " + user.GetName().getObjectAsString().getString());
      jxCdoSession.Logoff();
    } catch (UnknownHostException e) {
View Full Code Here

      JXCdoSession jxCdoSession = new JXCdoSession(
          ICredentialBag.machinecred_cdoinstalledhost,
          ICredentialBag.machinecred_domain,
          ICredentialBag.machinecred_username,
          ICredentialBag.machinecred_password);
      jxCdoSession.Logon(new JIString(
          ICredentialBag.logoncred_profilename).Variant,
          new JIString(ICredentialBag.logoncred_password).Variant,
          new JIVariant(false), new JIVariant(true), new JIVariant(
              false), new JIVariant(false), new JIString(
              ICredentialBag.logoncred_profileinfo).Variant);

     
            JXCdoFolder outbox = new JXCdoFolder(jxCdoSession,jxCdoSession.GetDefaultFolder(new JIVariant(JXCdoEnum.CdoDefaultFolderTypes.CdoDefaultFolderOutbox.intValue())));
            JXCdoMessages messages = new JXCdoMessages(jxCdoSession,outbox.GetMessages());
            JXCdoMessage message = new JXCdoMessage(jxCdoSession,messages.Add(new JIString("").Variant, new JIString("").Variant, JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM()));

            // set message subject and body
            message.SetSubject(new JIString("Test JXCdoMessage").Variant);
            message.SetText(new JIString("This is a test message sent from a Java program through j-XChange.").Variant);

            // set message recipients
            JXCdoRecipients recipients = new JXCdoRecipients(jxCdoSession,message.GetRecipients());
            JXCdoRecipient r1 = new JXCdoRecipient(jxCdoSession,recipients.Add(JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM()));
            JXCdoRecipient r2 = new JXCdoRecipient(jxCdoSession,recipients.Add(JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM()));

            // set recipients' addresses
            r1.SetName(new JIString("dont@spam.com").Variant);
            r2.SetName(new JIString("dont@spam2.com").Variant);

            // r1 will be the 'to' address and r2 will be 'cc'-ied
            r1.SetType(new JIVariant(JXCdoEnum.CdoRecipientType.CdoTo.intValue()));
            r2.SetType(new JIVariant(JXCdoEnum.CdoRecipientType.CdoCc.intValue()));
View Full Code Here

      JXCdoSession jxCdoSession = new JXCdoSession(
          ICredentialBag.machinecred_cdoinstalledhost,
          ICredentialBag.machinecred_domain,
          ICredentialBag.machinecred_username,
          ICredentialBag.machinecred_password);
      jxCdoSession.Logon(new JIString(
          ICredentialBag.logoncred_profilename).Variant,
          new JIString(ICredentialBag.logoncred_password).Variant,
          new JIVariant(false), new JIVariant(true), new JIVariant(
              false), new JIVariant(false), new JIString(
              ICredentialBag.logoncred_profileinfo).Variant);

      //       retrieve the inbox folder
      JXCdoFolder inbox = new JXCdoFolder(jxCdoSession,jxCdoSession.GetDefaultFolder(new JIVariant(JXCdoEnum.CdoDefaultFolderTypes.CdoDefaultFolderInbox.intValue())));

      //       get collection of subfolders under inbox
      JXCdoFolders inboxSubfolders = new JXCdoFolders(jxCdoSession,inbox.GetFolders());

      //       add a new folder named "Unread Emails" in this collection
      JXCdoFolder newFolder = new JXCdoFolder(jxCdoSession,inboxSubfolders.Add(new JIString("Test Emails").Variant));
     
             
      jxCdoSession.Logoff();
    } catch (UnknownHostException e) {
      // TODO Auto-generated catch block
View Full Code Here

            IJIComObject unknown = comStub.createInstance();
            IJIComObject comobject = unknown.queryInterface(IJIDispatch.IID);
            IJIDispatch shell = (IJIDispatch) JIObjectFactory.narrowObject(comobject);

            Object[] scriptArgs = new Object[]{
                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);
View Full Code Here

TOP

Related Classes of org.jinterop.dcom.core.JIString

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.