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>
                          • 主站蜘蛛池模板: nalgene洗瓶,nalgene量筒,nalgene窄口瓶,nalgene放水口大瓶,浙江省nalgene代理-杭州雷琪实验器材有限公司 | elisa试剂盒价格-酶联免疫试剂盒-猪elisa试剂盒-上海恒远生物科技有限公司 | 北京晚会活动策划|北京节目录制后期剪辑|北京演播厅出租租赁-北京龙视星光文化传媒有限公司 | 北京森语科技有限公司-模型制作专家-展览展示-沙盘模型设计制作-多媒体模型软硬件开发-三维地理信息交互沙盘 | 污水处理设备,一体化泵站,一体化净水设备-「梦之洁环保设备厂家」 | 沉降天平_沉降粒度仪_液体比重仪-上海方瑞仪器有限公司 | 标策网-专注公司商业知识服务、助力企业发展 | 浙江栓钉_焊钉_剪力钉厂家批发_杭州八建五金制造有限公司 | 大米加工设备|大米加工机械|碾米成套设备|大米加工成套设备-河南成立粮油机械有限公司 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 酒精检测棒,数显温湿度计,酒安酒精测试仪,酒精检测仪,呼气式酒精检测仪-郑州欧诺仪器有限公司 | 深圳公司注册-工商注册公司-千百顺代理记账公司 | 对夹式止回阀厂家,温州对夹式止回阀制造商--永嘉县润丰阀门有限公司 | 冷热冲击试验箱_温度冲击试验箱价格_冷热冲击箱排名_林频厂家 | 微型实验室真空泵-无油干式真空泵-微型涡旋耐腐蚀压缩机-思科涡旋科技(杭州)有限公司 | 电气控制系统集成商-PLC控制柜变频控制柜-非标自动化定制-电气控制柜成套-NIDEC CT变频器-威肯自动化控制 | 示波器高压差分探头-国产电流探头厂家-南京桑润斯电子科技有限公司 | 深圳成考网-深圳成人高考报名网 深圳工程师职称评定条件及流程_深圳职称评审_职称评审-职称网 | 压缩空气冷冻式干燥机_吸附式干燥机_吸干机_沪盛冷干机 | 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 气象监测系统_气象传感器_微型气象仪_气象环境监测仪-山东风途物联网 | 苏州教学设备-化工教学设备-环境工程教学模型|同科教仪 | 振动时效_振动时效仪_超声波冲击设备-济南驰奥机电设备有限公司 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 高通量组织研磨仪-多样品组织研磨仪-全自动组织研磨仪-研磨者科技(广州)有限公司 | 找培训机构_找学习课程_励普教育| 昊宇水工|河北昊宇水工机械工程有限公司 | 耐酸碱泵-自吸耐酸碱泵型号「品牌厂家」立式耐酸碱泵价格-昆山国宝过滤机有限公司首页 | 郑州巴特熔体泵有限公司专业的熔体泵,熔体齿轮泵与换网器生产厂家 | 板式换网器_柱式换网器_自动换网器-郑州海科熔体泵有限公司 | 生产加气砖设备厂家很多,杜甫机械加气砖设备价格公道 | ◆大型吹塑加工|吹塑加工|吹塑代加工|吹塑加工厂|吹塑设备|滚塑加工|滚塑代加工-莱力奇塑业有限公司 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 法兰连接型电磁流量计-蒸汽孔板节流装置流量计-北京凯安达仪器仪表有限公司 | 福兰德PVC地板|PVC塑胶地板|PVC运动地板|PVC商用地板-中国弹性地板系统专业解决方案领先供应商! 福建成考网-福建成人高考网 | 天然气分析仪-液化气二甲醚分析仪|传昊仪器| 包装机_厂家_价格-山东包装机有限公司| 冷却塔减速机器_冷却塔皮带箱维修厂家_凉水塔风机电机更换-广东康明冷却塔厂家 | 真空吸污车_高压清洗车厂家-程力专用汽车股份有限公司官网 | 月嫂_保姆_育婴_催乳_母婴护理_产后康复_养老护理-吉祥到家家政 硫酸亚铁-聚合硫酸铁-除氟除磷剂-复合碳源-污水处理药剂厂家—长隆科技 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 反渗透水处理设备|工业零排放|水厂设备|软化水设备|海南净水设备--海南水处理设备厂家 |