首页 文章

将IM应用程序与Outlook 2010/2013集成

提问于
浏览
0

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

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

应用程序示例代码 .

[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);
        }

错误如:

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

  • CMsoIMProviderFactory :: HrEnsureDefaultIMAppRegKeys成功查询注册表项(HKCU:SOFTWARE \ IM Providers:DefaultIMApp:ContactCardDesktop)

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

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

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

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

  • CMsoIMProviderFactory :: HrGetAvailableProvider!失败了!行:409小时= 0x80040154小时= 80040154,我们无法确定我们现在尝试使用LCClient CLSID手动CoCreate的提供程序类型

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

1 回答

相关问题