将IM应用程序与outlook 2010/2013集成
本文关键字:2010 2013集成 outlook IM 应用程序 | 更新日期: 2023-09-27 18:27:33
我已经按照链接的建议实现了IM应用程序(名称为"ContactCardDesktop.exe")https://msdn.microsoft.com/en-us/library/office/jj900715(v=office.15).aspx我已经根据文章完成了所有的注册表设置。但是对于函数GetAuthenticationInfo()和GetInterface()没有对outlook到IM应用程序的调用。甚至没有在注册表位置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提供商)
- 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手动创建
- CMsoIMProviderFactory::HrGetAvailableProvider!失败!行:409 hr=0x80040154 hr=80040154,我们无法识别提供程序类型,我们现在尝试使用LCClient CLSID手动CoCreate
- CMsoIMProviderFactory::HrGetAvailableProvider!失败!线路:289小时=0x80004005!!!提供程序初始化失败
我已经解决了这个问题,可以使用位于https://code.msdn.microsoft.com/windowsapps/CSExeCOMServer-3b1c1054