pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

        <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="iupou7w" 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="kkbtou3" 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";錯誤的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

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

                  <塊引用>

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

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

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

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

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

                  但是,最后一行失敗并出現(xiàn)以下異常:

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

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

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

                  <塊引用>

                  1.7 版還包括閱讀代碼類型庫直接來自天才.這使得工作成為可能與所有 Microsoft Office應(yīng)用程序事件,以及 IE5事件.有關(guān)示例,請參見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");

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

                  解決方案

                  經(jīng)過一些實(shí)驗(yàn),我確定我可以通過訂閱 MailItemClose 事件 而不是 Inspector關(guān)閉事件.我現(xiàn)在有一個(gè)處理所有 MailItemEventHandler 類"nofollow noreferrer">MailItem 事件:

                  公共類 MailItemEventHandler {公共無效附件添加(變體[]參數(shù)){System.out.println("附件添加");}公共無效附件讀取(變量[]參數(shù)){System.out.println("附件讀取");}公共無效附件刪除(變量[]參數(shù)){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("刪除前");}公共無效關(guān)閉(變量[]參數(shù)){System.out.println("關(guān)閉");}公共無效CustomAction(變體[]參數(shù)){System.out.println("CustomAction");}公共無效CustomPropertyChange(變量[]參數(shù)){System.out.println("CustomPropertyChange");}公共無效轉(zhuǎn)發(fā)(變體[]參數(shù)){System.out.println("轉(zhuǎn)發(fā)");}公共無效開放(變體[]參數(shù)){System.out.println("打開");}公共無效PropertyChange(變體[]參數(shù)){System.out.println("PropertyChange");}公共無效讀取(變量[]參數(shù)){System.out.println("讀取");}公共無效回復(fù)(變體[]參數(shù)){System.out.println("回復(fù)");}公共無效回復(fù)所有(變體[]參數(shù)){System.out.println("ReplyAll");}公共無效發(fā)送(變體[]參數(shù)){System.out.println("發(fā)送");}公共無效卸載(變體[]參數(shù)){System.out.println("卸載");}公共無效寫入(變體 [] 參數(shù)){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...

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

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

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個(gè)隨機(jī)打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?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="3zrpk73" 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>
                          • 主站蜘蛛池模板: 湖南自考_湖南自学考试| 英思科GTD-3000EX(美国英思科气体检测仪MX4MX6)百科-北京嘉华众信科技有限公司 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 江苏南京多语种翻译-专业翻译公司报价-正规商务翻译机构-南京华彦翻译服务有限公司 | 超声骨密度仪-动脉硬化检测仪器-人体成分分析仪厂家/品牌/价格_南京科力悦 | 卫生型双针压力表-高温防腐差压表-安徽康泰电气有限公司 | 广东风淋室_广东风淋室厂家_广东风淋室价格_广州开源_传递窗_FFU-广州开源净化科技有限公司 | 湖南印刷厂|长沙印刷公司|画册印刷|挂历印刷|台历印刷|杂志印刷-乐成印刷 | 微型气泵-真空-蠕动-水泵-厂家-深圳市品亚科技有限公司 | 缝纫客| 浇钢砖,流钢砖_厂家价低-淄博恒森耐火材料有限公司 | 自动检重秤-动态称重机-重量分选秤-苏州金钻称重设备系统开发有限公司 | 大倾角皮带机-皮带输送机-螺旋输送机-矿用皮带输送机价格厂家-河南坤威机械 | 双效节能浓缩器-热回流提取浓缩机组-温州市利宏机械 | 污水提升器,污水提升泵,污水提升装置-德国泽德(zehnder)水泵系统有限公司 | 共享雨伞_共享童车_共享轮椅_共享陪护床-共享产品的领先者_有伞科技 | 杭州月嫂技术培训服务公司-催乳师培训中心报名费用-产后康复师培训机构-杭州优贝姆健康管理有限公司 | 低粘度纤维素|混凝土灌浆料|有机硅憎水粉|聚羧酸减水剂-南京斯泰宝 | 高效复合碳源-多核碳源生产厂家-污水处理反硝化菌种一长隆科技库巴鲁 | 考勤系统_考勤管理系统_网络考勤软件_政企|集团|工厂复杂考勤工时统计排班管理系统_天时考勤 | 点焊机-缝焊机-闪光对焊机-电阻焊设备生产厂家-上海骏腾发智能设备有限公司 | 柴油机_柴油发电机_厂家_品牌-江苏卡得城仕发动机有限公司 | 铝合金线槽_铝型材加工_空调挡水板厂家-江阴炜福金属制品有限公司 | 蓝牙音频分析仪-多功能-四通道-八通道音频分析仪-东莞市奥普新音频技术有限公司 | 优考试_免费在线考试系统_培训考试系统_题库系统_组卷答题系统_匡优考试 | SMC-ASCO-CKD气缸-FESTO-MAC电磁阀-上海天筹自动化设备官网 | 水平筛厂家-三轴椭圆水平振动筛-泥沙震动筛设备_山东奥凯诺矿机 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | 电动车头盔厂家_赠品头盔_安全帽批发_山东摩托车头盔—临沂承福头盔 | 软文世界-软文推广-软文营销-新闻稿发布-一站式软文自助发稿平台 | 电动车头盔厂家_赠品头盔_安全帽批发_山东摩托车头盔—临沂承福头盔 | 禹城彩钢厂_钢结构板房_彩钢复合板-禹城泰瑞彩钢复合板加工厂 | 网站建设-高端品牌网站设计制作一站式定制_杭州APP/微信小程序开发运营-鼎易科技 | 对照品_中药对照品_标准品_对照药材_「格利普」高纯中药标准品厂家-成都格利普生物科技有限公司 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 高温高压釜(氢化反应釜)百科| 「安徽双凯」自动售货机-无人售货机-成人用品-自动饮料食品零食售货机 | 京港视通报道-质量走进大江南北-京港视通传媒[北京]有限公司 | 蓝鹏测控平台 - 智慧车间系统 - 车间生产数据采集与分析系统 | 成都热收缩包装机_袖口式膜包机_高速塑封机价格_全自动封切机器_大型套膜机厂家 | 圆窗水平仪|伊莉莎冈特elesa+ganter | 博客-悦享汽车品质生活 | PVC快速门-硬质快速门-洁净室快速门品牌厂家-苏州西朗门业 |