本文介绍了将IM应用程序与Outlook 2010/2013集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照链接/文章"将IM应用程序与Office集成"的建议实现了IM应用程序(名称为"ContactCardDesktop.exe")。 https://msdn.microsoft.com/en-us/library/office/jj900715(v=office.15).aspx 我有
完成了本文的所有注册表设置。但是没有从outlook到IM应用程序调用函数GetAuthenticationInfo()和GetInterface()。甚至没有在注册表位置HKCU \Software \IM Providers \ContactCardDesktop获取ProcessID。



在Outlook日志中我收到的错误如下。我已经完成了许多建议,但没有多少帮助。请提出问题/解决方案。



申请的示例代码。



[ClassInterface(ClassInterfaceType.None) )]¥b $ b    [ComSourceInterfaces(typeof(_IUCOfficeIntegrationEvents))]

    [ProgId("LitwareClientAppObject.Class")]
$
    [Guid(" 449B04AD-32A8-4D21-B0AE-8FC316E051CE"),ComVisible(true)]
$


    public partial class LitwareClientAppObject:IUCOfficeIntegration

    {

        IMClient imClient;

       自动化自动化;



        public LitwareClientAppObject()

        {

            InitializeComponent();

            imClient = new IMClient();

            imAutomation = new IMClientAutomation();

        }¥b $ b        //省略了实施细节。

        public string GetAuthenticationInfo(string _version)

        {

            string supportedOfficeVersion =" 15.0.0.0";

            //做一个简单的等效检查。

            if(supportedOfficeVersion == _version)

            {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;返回"< authenticationinfo>" ;;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;否则

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;返回null;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; }


  &NBSP; &NBSP; &NBSP; public object GetInterface(string _version,OIInterface _interface)

  &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; IMClient imClient = new IMClient();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; IMClientAutomation imAutomation = new IMClientAutomation();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;开关(_接口)

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; case OIInterface.oiInterfaceILyncClient:

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; return imClient;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; case OIInterface.oiInterfaceIAutomation:

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; return imAutomation;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;默认值:

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;抛出新的NotImplementedException();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; }


  &NBSP; &NBSP; &NBSP; public OIFeature GetSupportedFeatures(string _version)

  &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; OIFeature supportedFeature1 = OIFeature.oiFeatureQuickContacts;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; OIFeature supportedFeature2 = OIFeature.oiFeatureFastSearch;



  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; return(supportedFeature1 | supportedFeature2);

  &NBSP; &NBSP; &NBSP; }¥b $ b错误如:



CMsoIMProviderFactory :: HrEnsureDefaultIMAppRegKeys成功打开注册码(HKCU:SOFTWARE \IM提供商)

CMsoIMProviderFactory :: HrEnsureDefaultIMAppRegKeys成功查询注册表项(HKCU:SOFTWARE \IM提供商:DefaultIMApp:ContactCardDesktop)

CMsoIMProviderFactory :: HrEnsureDefaultIMProcessRegKey成功打开注册表项(HKCU:SOFTWARE \IM Providers \ ContactCardDesktop)

CMsoIMProviderFactory :: HrEnsureDefaultIMProcessRegKey成功打开reg键(HKLM:SOFTWARE \IM Providers \ ContactCardDesktop)

CMsoIMProviderFactory :: WhichMessengerInProcessList使用(ContactCardDesktop.exe)进程名称用于搜索



CMsoIMProviderFactory :: WhichMessengerInProcessList使用(ContactCardDesktop.exe)进程名称搜索hr = 80040154,我们无法识别我们现在尝试手动CoCreate的提供程序类型使用LCClient CLSID

CMsoIMProviderFactory :: HrGe tAvailableProvider!失败了!行:409小时= 0x80040154小时= 80040154,我们无法识别我们现在尝试使用LCClient CLSID手动CoCreate的提供者类型

CMsoIMProviderFactory :: HrGetAvailableProvider!失败!行:289小时= 0x80004005 !!!提供商初始化失败!!!

I have implemented the IM application (name is "ContactCardDesktop.exe") as suggested by the link/article "Integrating IM applications with Office" https://msdn.microsoft.com/en-us/library/office/jj900715(v=office.15).aspx I have done all the registry setting per the article. but there is no call from outlook to IM application for function GetAuthenticationInfo() and GetInterface(). Even not getting the ProcessID at registry location HKCU\Software\IM Providers\ContactCardDesktop.

In outlook logs I am getting errors attached below. I have gone through to many suggestion but didn't get help much. Please suggest the problem/solution.

Sample code for Application.

[ClassInterface(ClassInterfaceType.None)]
    [ComSourceInterfaces(typeof(_IUCOfficeIntegrationEvents))]
    [ProgId("LitwareClientAppObject.Class")]
    [Guid("449B04AD-32A8-4D21-B0AE-8FC316E051CE"), ComVisible(true)]

    public partial class LitwareClientAppObject : IUCOfficeIntegration
    {
        IMClient imClient;
        Automation imAutomation;

        public LitwareClientAppObject()
        {
            InitializeComponent();
            imClient = new IMClient();
            imAutomation = new IMClientAutomation();
        }
        // Implementation details omitted.
        public string GetAuthenticationInfo(string _version)
        {
            string supportedOfficeVersion = "15.0.0.0";
            // Do a simple check for equivalency.
            if (supportedOfficeVersion == _version)
            {
                return "<authenticationinfo>";
            }
            else
            {
                return null;
            }
        }

        public object GetInterface(string _version, OIInterface _interface)
        {
            IMClient imClient = new IMClient();
            IMClientAutomation imAutomation = new IMClientAutomation();
            switch (_interface)
            {
                case OIInterface.oiInterfaceILyncClient:
                    {
                        return imClient;
                    }
                case OIInterface.oiInterfaceIAutomation:
                    {
                        return imAutomation;
                    }
                default:
                    {
                        throw new NotImplementedException();
                    }
            }
        }

        public OIFeature GetSupportedFeatures(string _version)
        {
            OIFeature supportedFeature1 = OIFeature.oiFeatureQuickContacts;
            OIFeature supportedFeature2 = OIFeature.oiFeatureFastSearch;

            return (supportedFeature1 | supportedFeature2);
        }
Errors like:

CMsoIMProviderFactory::HrEnsureDefaultIMAppRegKeys Succeeded opening reg key (HKCU:SOFTWARE\IM Providers)
CMsoIMProviderFactory::HrEnsureDefaultIMAppRegKeys Succeeded querying reg key (HKCU:SOFTWARE\IM Providers:DefaultIMApp:ContactCardDesktop)
CMsoIMProviderFactory::HrEnsureDefaultIMProcessRegKey Succeeded opening reg key (HKCU:SOFTWARE\IM Providers\ContactCardDesktop)
CMsoIMProviderFactory::HrEnsureDefaultIMProcessRegKey Succeeded opening reg key (HKLM:SOFTWARE\IM Providers\ContactCardDesktop)
CMsoIMProviderFactory::WhichMessengerInProcessList Using (ContactCardDesktop.exe) process name for search

CMsoIMProviderFactory::WhichMessengerInProcessList Using (ContactCardDesktop.exe) process name for search hr = 80040154, We couldn't identify the provider type we now try to manually CoCreate using the LCClient CLSID
CMsoIMProviderFactory::HrGetAvailableProvider !failed! Line: 409 hr = 0x80040154 hr = 80040154, We couldn't identify the provider type we now try to manually CoCreate using the LCClient CLSID
CMsoIMProviderFactory::HrGetAvailableProvider !failed! Line: 289 hr = 0x80004005 !!!Provider Initialization Failed!!!

推荐答案

在2010年和2013年,这个错误都发生了吗?根据以下链接,该文档似乎仅适用于Outlook 2013.

Did this error happen both in outlook 2010 and 2013? Based on the link below, it seems this document worked only in Outlook 2013.

#如何为Outlook 2010实施第三方IM提供程序

https://social.msdn.microsoft.com/Forums/office/en-US/267c7f13-eaf4-4296-8256-bce921093361/how-to -implement-a-3rd-party-im-provider-for-outlook-2010?forum = outlookdev

# How to implement a 3rd party IM provider for Outlook 2010
https://social.msdn.microsoft.com/Forums/office/en-US/267c7f13-eaf4-4296-8256-bce921093361/how-to-implement-a-3rd-party-im-provider-for-outlook-2010?forum=outlookdev

最好的问候,

Best Regards,

Edward


这篇关于将IM应用程序与Outlook 2010/2013集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 18:51