久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='FlF6s'></bdo><ul id='FlF6s'></ul>
    1. <tfoot id='FlF6s'></tfoot>
    2. <i id='FlF6s'><tr id='FlF6s'><dt id='FlF6s'><q id='FlF6s'><span id='FlF6s'><b id='FlF6s'><form id='FlF6s'><ins id='FlF6s'></ins><ul id='FlF6s'></ul><sub id='FlF6s'></sub></form><legend id='FlF6s'></legend><bdo id='FlF6s'><pre id='FlF6s'><center id='FlF6s'></center></pre></bdo></b><th id='FlF6s'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='FlF6s'><tfoot id='FlF6s'></tfoot><dl id='FlF6s'><fieldset id='FlF6s'></fieldset></dl></div>

      1. <small id='FlF6s'></small><noframes id='FlF6s'>

        <legend id='FlF6s'><style id='FlF6s'><dir id='FlF6s'><q id='FlF6s'></q></dir></style></legend>

      2. Java、Jacob 和 Microsoft Outlook 事件:接收“無法找到

        Java, Jacob and Microsoft Outlook events: Receiving quot;Can#39;t find event iidquot; Error(Java、Jacob 和 Microsoft Outlook 事件:接收“無法找到事件 iid;錯誤)
      3. <tfoot id='lrB7I'></tfoot>
      4. <legend id='lrB7I'><style id='lrB7I'><dir id='lrB7I'><q id='lrB7I'></q></dir></style></legend>

        <i id='lrB7I'><tr id='lrB7I'><dt id='lrB7I'><q id='lrB7I'><span id='lrB7I'><b id='lrB7I'><form id='lrB7I'><ins id='lrB7I'></ins><ul id='lrB7I'></ul><sub id='lrB7I'></sub></form><legend id='lrB7I'></legend><bdo id='lrB7I'><pre id='lrB7I'><center id='lrB7I'></center></pre></bdo></b><th id='lrB7I'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lrB7I'><tfoot id='lrB7I'></tfoot><dl id='lrB7I'><fieldset id='lrB7I'></fieldset></dl></div>
        • <small id='lrB7I'></small><noframes id='lrB7I'>

            <bdo id='lrB7I'></bdo><ul id='lrB7I'></ul>
              <tbody id='lrB7I'></tbody>

                  本文介紹了Java、Jacob 和 Microsoft Outlook 事件:接收“無法找到事件 iid";錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在編寫一個使用 Jacob 庫(橋接 COM 和 Java)與 Microsoft Outlook 交互的 Java 程序).該程序創建一個新的 MailItem,顯示它的Inspector 窗口給用戶.我希望訂閱檢查員的 關閉事件 知道用戶何時完成了他們的郵件項目的編輯.

                  要訂閱該活動,我按照 Jacob 的文檔 中的說明進行操作(關于 23 在頁面下方):

                  <塊引用>

                  當前的 [event] 模型在概念上是類似于 Visual Basic WithEvents構造.基本上,我提供了一個類稱為com.jacob.com.DispatchEvents 其中有一個接受源的構造函數對象(類型com.jacob.com.Dispatch) 和一個目標對象(任何類型).來源查詢對象的IConnectionPointContainer 接口我試圖獲得一個IConnectionPoint 為其默認值源接口(我從IProvideClassInfo).同時,我還創建了 DISPID 的映射對于默認源接口實際的方法名稱.然后我用獲取 jmethodID 的方法名稱來自目標 Java 對象的句柄.目前所有的事件方法都必須有相同的簽名:一個論點是一個 Java 變體數組,以及一個void 返回類型.

                  這是我的 InspectorEventHandler 類,符合 Jacob 的文檔:

                  公共類 InspectorEventHandler {公共無效激活(變體[]參數){}public void BeforeMaximize(Variant[] arguments) {}public void BeforeMinimize(Variant[] arguments) {}public void BeforeMove(Variant[] arguments) {}public void BeforeSize(Variant[] arguments) {}公共無效關閉(變量[]參數){System.out.println("關閉");}公共無效停用(變體[]參數){}公共無效頁面更改(變體 [] 參數){}}

                  下面是我使用這個 InspectorEventHandler 類訂閱事件的方式:

                  Object outlook = new ActiveXComponent("Outlook.Application");對象 mailItem = Dispatch.call(outlook, "CreateItem", 0).getDispatch();對象檢查器 = Dispatch.get(mailItem, "GetInspector").getDispatch();InspectorEventHandler eventHandler = new InspectorEventHandler();//這應該向檢查器注冊 eventHandlernew DispatchEvents((Dispatch) 檢查器,eventHandler);

                  但是,最后一行失敗并出現以下異常:

                  <上一頁>線程主"com.jacob.com.ComFailException 中的異常:找不到事件 iid在 com.jacob.com.DispatchEvents.init(本機方法)在 com.jacob.com.DispatchEvents.(DispatchEvents.java)在 cake.CakeApplication.run(CakeApplication.java:30)在 cake.CakeApplication.main(CakeApplication.java:15)無法獲得 IProvideClassInfo

                  根據谷歌,其他一些人也收到此錯誤.不幸的是,他們都沒有收到答復.

                  我正在使用 Jacob 庫的 1.7 版,它聲稱可以防止此問題:

                  <塊引用>

                  1.7 版還包括閱讀代碼類型庫直接來自天才.這使得工作成為可能與所有 Microsoft Office應用程序事件,以及 IE5事件.有關示例,請參見samples/test/IETest.java 示例.

                  我注意到前面提到的 IETest.java 文件訂閱了這樣的事件:

                  new DispatchEvents((Dispatch) ieo, ieE,"InternetExplorer.Application.1");

                  因此,我嘗試以類似的方式訂閱我的活動:

                  new DispatchEvents((Dispatch) 檢查器, eventHandler, "Outlook.Application");new DispatchEvents((Dispatch) 檢查器,eventHandler,Outlook.Application.1");new DispatchEvents((Dispatch) 檢查器,eventHandler,Outlook.Application.12");

                  所有這些嘗試都因相同的錯誤而失敗.

                  解決方案

                  經過一些實驗,我確定我可以通過訂閱 MailItemClose 事件 而不是 Inspector關閉事件.我現在有一個處理所有 MailItemEventHandler 類"nofollow noreferrer">MailItem 事件:

                  公共類 MailItemEventHandler {公共無效附件添加(變體[]參數){System.out.println("附件添加");}公共無效附件讀取(變量[]參數){System.out.println("附件讀取");}公共無效附件刪除(變量[]參數){System.out.println("附件刪除");}public void BeforeAttachmentAdd(Variant[] arguments) {System.out.println("BeforeAttachmentAdd");}public void BeforeAttachmentPreview(Variant[] arguments) {System.out.println("BeforeAttachmentPreview");}public void BeforeAttachmentRead(Variant[] arguments) {System.out.println("BeforeAttachmentRead");}public void BeforeAttachmentSave(Variant[] arguments) {System.out.println("BeforeAttachmentSave");}public void BeforeAttachmentWriteToTempFile(Variant[] arguments) {System.out.println("BeforeAttachmentWriteToTempFile");}public void BeforeAutoSave(Variant[] arguments) {System.out.println("自動保存前");}public void BeforeCheckNames(Variant[] arguments) {System.out.println("BeforeCheckNames");}public void BeforeDelete(Variant[] arguments) {System.out.println("刪除前");}公共無效關閉(變量[]參數){System.out.println("關閉");}公共無效CustomAction(變體[]參數){System.out.println("CustomAction");}公共無效CustomPropertyChange(變量[]參數){System.out.println("CustomPropertyChange");}公共無效轉發(變體[]參數){System.out.println("轉發");}公共無效開放(變體[]參數){System.out.println("打開");}公共無效PropertyChange(變體[]參數){System.out.println("PropertyChange");}公共無效讀取(變量[]參數){System.out.println("讀取");}公共無效回復(變體[]參數){System.out.println("回復");}公共無效回復所有(變體[]參數){System.out.println("ReplyAll");}公共無效發送(變體[]參數){System.out.println("發送");}公共無效卸載(變體[]參數){System.out.println("卸載");}公共無效寫入(變體 [] 參數){System.out.println("寫");}}

                  我使用以下方式訂閱事件:

                  Object outlook = new ActiveXComponent("Outlook.Application");對象 mailItem = Dispatch.call(outlook, "CreateItem", 0).getDispatch();MailItemEventHandler eventHandler = new MailItemEventHandler();新的 DispatchEvents((Dispatch) mailItem, eventHandler);

                  我對COM了解不多,但是看來Inspector對象注冊有問題...

                  I am writing a Java program that interacts with Microsoft Outlook using the Jacob library (bridges COM and Java). This program creates a new MailItem, displaying its Inspector window to the user. I wish to subscribe to the inspector's Close event to know when the user is finished editing their mail item.

                  To subscribe to the event, I followed the instructions in Jacob's documentation (about 23 down the page):

                  The current [event] model is conceptually similar to the Visual Basic WithEvents construct. Basically, I provide a class called com.jacob.com.DispatchEvents which has a constructor that takes a source object (of type com.jacob.com.Dispatch) and a target object (of any type). The source object is queried for its IConnectionPointContainer interface and I attempt to obtain an IConnectionPoint for its default source interface (which I obtain from IProvideClassInfo). At the same time, I also create a mapping of DISPID's for the default source interface to the actual method names. I then use the method names to get jmethodID handles from the target Java object. All event methods currently must have the same signature: one argument which is a Java array of Variants, and a void return type.

                  Here is my InspectorEventHandler class, conforming to Jacob's documentation:

                  public class InspectorEventHandler {
                  
                      public void Activate(Variant[] arguments) {
                  
                      }
                  
                      public void BeforeMaximize(Variant[] arguments) {
                  
                      }
                  
                      public void BeforeMinimize(Variant[] arguments) {
                  
                      }
                  
                      public void BeforeMove(Variant[] arguments) {
                  
                      }
                  
                      public void BeforeSize(Variant[] arguments) {
                  
                      }
                  
                      public void Close(Variant[] arguments) {
                          System.out.println("Closing");
                      }
                  
                      public void Deactivate(Variant[] arguments) {
                  
                      }
                  
                      public void PageChange(Variant[] arguments) {
                  
                      }
                  
                  }
                  

                  And here is how I subscribe to the events using this InspectorEventHandler class:

                  Object outlook = new ActiveXComponent("Outlook.Application");
                  Object mailItem = Dispatch.call(outlook, "CreateItem", 0).getDispatch();
                  Object inspector = Dispatch.get(mailItem, "GetInspector").getDispatch();
                  
                  InspectorEventHandler eventHandler = new InspectorEventHandler();
                  
                  // This supposedly registers eventHandler with the inspector
                  new DispatchEvents((Dispatch) inspector, eventHandler);
                  

                  However, the last line fails with the following exception:

                  Exception in thread "main" com.jacob.com.ComFailException: Can't find event iid
                      at com.jacob.com.DispatchEvents.init(Native Method)
                      at com.jacob.com.DispatchEvents.(DispatchEvents.java)
                      at cake.CakeApplication.run(CakeApplication.java:30)
                      at cake.CakeApplication.main(CakeApplication.java:15)
                  couldn't get IProvideClassInfo
                  

                  According to Google, a few others have also received this error. Unfortunately, none of them have received an answer.

                  I am using version 1.7 of the Jacob library, which claims to prevent this problem:

                  Version 1.7 also includes code to read the type library directly from the progid. This makes it possible to work with all the Microsoft Office application events, as well as IE5 events. For an example see the samples/test/IETest.java example.

                  I noticed that the aforementioned IETest.java file subscribes to events like this:

                  new DispatchEvents((Dispatch) ieo, ieE,"InternetExplorer.Application.1");
                  

                  Therefore, I tried subscribing to my events in a similar manner:

                  new DispatchEvents((Dispatch) inspector, eventHandler, "Outlook.Application");
                  new DispatchEvents((Dispatch) inspector, eventHandler, "Outlook.Application.1");
                  new DispatchEvents((Dispatch) inspector, eventHandler, "Outlook.Application.12");
                  

                  All these attempts failed with the same error.

                  解決方案

                  After some experimentation, I determined that I could achieve the desired result by subscribing to the MailItem's Close event rather than the Inspector's Close event. I now have a MailItemEventHandler class that handles all MailItem events:

                  public class MailItemEventHandler {
                  
                      public void AttachmentAdd(Variant[] arguments) {
                          System.out.println("AttachmentAdd");
                      }
                  
                      public void AttachmentRead(Variant[] arguments) {
                          System.out.println("AttachmentRead");
                      }
                  
                      public void AttachmentRemove(Variant[] arguments) {
                          System.out.println("AttachmentRemove");
                      }
                  
                      public void BeforeAttachmentAdd(Variant[] arguments) {
                          System.out.println("BeforeAttachmentAdd");
                      }
                  
                      public void BeforeAttachmentPreview(Variant[] arguments) {
                          System.out.println("BeforeAttachmentPreview");
                      }
                  
                      public void BeforeAttachmentRead(Variant[] arguments) {
                          System.out.println("BeforeAttachmentRead");
                      }
                  
                      public void BeforeAttachmentSave(Variant[] arguments) {
                          System.out.println("BeforeAttachmentSave");
                      }
                  
                      public void BeforeAttachmentWriteToTempFile(Variant[] arguments) {
                          System.out.println("BeforeAttachmentWriteToTempFile");
                      }
                  
                      public void BeforeAutoSave(Variant[] arguments) {
                          System.out.println("BeforeAutoSave");
                      }
                  
                      public void BeforeCheckNames(Variant[] arguments) {
                          System.out.println("BeforeCheckNames");
                      }
                  
                      public void BeforeDelete(Variant[] arguments) {
                          System.out.println("BeforeDelete");
                      }
                  
                      public void Close(Variant[] arguments) {
                          System.out.println("Close");
                      }
                  
                      public void CustomAction(Variant[] arguments) {
                          System.out.println("CustomAction");
                      }
                  
                      public void CustomPropertyChange(Variant[] arguments) {
                          System.out.println("CustomPropertyChange");
                      }
                  
                      public void Forward(Variant[] arguments) {
                          System.out.println("Forward");
                      }
                  
                      public void Open(Variant[] arguments) {
                          System.out.println("Open");
                      }
                  
                      public void PropertyChange(Variant[] arguments) {
                          System.out.println("PropertyChange");
                      }
                  
                      public void Read(Variant[] arguments) {
                          System.out.println("Read");
                      }
                  
                      public void Reply(Variant[] arguments) {
                          System.out.println("Reply");
                      }
                  
                      public void ReplyAll(Variant[] arguments) {
                          System.out.println("ReplyAll");
                      }
                  
                      public void Send(Variant[] arguments) {
                          System.out.println("Send");
                      }
                  
                      public void Unload(Variant[] arguments) {
                          System.out.println("Unload");
                      }
                  
                      public void Write(Variant[] arguments) {
                          System.out.println("Write");
                      }
                  
                  }
                  

                  I subscribe to the events using:

                  Object outlook = new ActiveXComponent("Outlook.Application");
                  Object mailItem = Dispatch.call(outlook, "CreateItem", 0).getDispatch();
                  
                  MailItemEventHandler eventHandler = new MailItemEventHandler();
                  new DispatchEvents((Dispatch) mailItem, eventHandler);
                  

                  I don't know much about COM, but it appears that there is something wrong with the Inspector object registration...

                  這篇關于Java、Jacob 和 Microsoft Outlook 事件:接收“無法找到事件 iid";錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                  1. <legend id='3U5Fs'><style id='3U5Fs'><dir id='3U5Fs'><q id='3U5Fs'></q></dir></style></legend>
                      <tbody id='3U5Fs'></tbody>
                  2. <small id='3U5Fs'></small><noframes id='3U5Fs'>

                    <i id='3U5Fs'><tr id='3U5Fs'><dt id='3U5Fs'><q id='3U5Fs'><span id='3U5Fs'><b id='3U5Fs'><form id='3U5Fs'><ins id='3U5Fs'></ins><ul id='3U5Fs'></ul><sub id='3U5Fs'></sub></form><legend id='3U5Fs'></legend><bdo id='3U5Fs'><pre id='3U5Fs'><center id='3U5Fs'></center></pre></bdo></b><th id='3U5Fs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3U5Fs'><tfoot id='3U5Fs'></tfoot><dl id='3U5Fs'><fieldset id='3U5Fs'></fieldset></dl></div>
                      <bdo id='3U5Fs'></bdo><ul id='3U5Fs'></ul>

                            <tfoot id='3U5Fs'></tfoot>
                          • 主站蜘蛛池模板: 成人国产网站 | 国产成人免费视频网站高清观看视频 | 国产丝袜人妖cd露出 | 伊人99| www.xxxx欧美| 日韩三级电影一区二区 | 欧美激情亚洲 | 一级看片免费视频囗交动图 | 国产精品高潮呻吟久久av野狼 | 99久久久久 | 国产高清视频一区 | 精品区一区二区 | 久久精品性视频 | 欧美黄色一区 | 欧美中文一区 | 欧美理伦片在线播放 | 日本在线一二 | 久久久久成人精品亚洲国产 | 亚洲高清久久 | 亚洲444eee在线观看 | 天堂网avav| 在线观看中文字幕dvd播放 | 亚洲国产偷 | 黄免费在线| 亚洲视频www| 久在草 | 激情a | 在线看免费 | 欧美视频在线播放 | 久久黄网 | a欧美| 伊人成人免费视频 | 一区二区三区四区国产 | 99免费精品视频 | 一区二区三区免费看 | 天堂色| 激情五月激情综合网 | 国产一级免费在线观看 | 欧美日韩在线一区二区三区 | 精品亚洲91| 久久国产欧美日韩精品 |