none
How to implement an IM provide for outlook RRS feed

  • Question

  • Hi,

    recently, I have found the link http://www.microsoft.com/en-us/download/details.aspx?id=23841. according to it we can integrate the 3rd IM app into outlook. like lync and msn. user can see the presence, send IM and dial the number. and I have tested it by using msn and lync. both of them can work fine.

    If I want to integrate my IM app into outlook. I need to write a out-of-process COM and implement those interface.  Now, I have some questions.

    1. which interfaces need be implemented? My app need to support to outlook 2007,2010 and 2012.

    2. I want use those *.idl and *.h mentioned in the Windows Messenger Client Reference(http://msdn.microsoft.com/en-us/library/ms630961.aspx). but I do not find any SDK or others provide for us to download. Please tell me how can I get it?

    3. I find that this COM should be implemented by using C++. Could you tell me if it can be implement by C#.

    Thank you very much.

    Best Regards.

    Monday, August 13, 2012 11:37 AM

Answers

  • The process you see in the logs is Office trying to determine what type of IM provider you are.  Let's call this phase "Provider Discovery".  As you can see Office asks if you are a OCOM provider, followed by a OC20 provider, and so on.  If you are following the online article you list above then you want to be known as a OC20 provider.  However because you don't implement IMessengerAdvanced, Office moves on and tries to determine if you are a Windows Live IM provider.  Make sure you implement ALL IMessenger* interfaces including IMessengerAdvanced.  That should get you past this hurdle.

    Also, in regards to general IM provider integration make sure you review all the posts I have responded to regarding this topic thus far.  This should be helpful to you.

    HTH,

    Dave

    ** Note: I using the term 'Office' on purpose because the IM integration is done in a shared component between all of the office apps.  Therefore, if you get this working in one Office app it should work in all.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members.

    Tuesday, September 4, 2012 1:07 PM

All replies

  • Does any body can help me?
    Tuesday, August 14, 2012 9:16 AM
  • this topic was described on here multiple times, search a little. As for 3rd question - as this is out of process COM server you can theoretically try any language that can obey COM rules, if you want, try out c#, of course you will have some adventures translating structures and unions to C#.

    Tuesday, August 14, 2012 9:38 AM
  • DamianD,

    Thanks for your reply. I have found those topic.

    Now I do not know how to implement the out of process COM. which interface, method and event should be implement. I have written a COM by using C#. My class is sample and inherited IMessenger. when I running outlook, my class can be called but just call CreateInstance. and this method will be called about 3 times. but other methods of IMessenger do not call.

    So could you tell me how to write this COM. if it is possible please give me a demo.

    Thank you very much!

    Thursday, August 16, 2012 5:23 AM
  • i cannot help you with that, sorry. But there are plenty of examples on the 'net, here is one http://code.msdn.microsoft.com/windowsdesktop/CSExeCOMServer-f2a59967
    Thursday, August 16, 2012 9:35 AM
  • Thank you.

    I have read the link. and using that example.

    but now it seems that outlook does not call the methods or event which belong to IMessenger API.

    The contact card can be displayed. but The button SendIM is disable.

    Thursday, August 16, 2012 9:41 AM
  • have you enabled logging of that coomunication? try looking there if outlook is not happy about something. Also it may depend on fact how you wrote your C# server.
    Thursday, August 16, 2012 11:14 AM
  • Thank you very much!

    I enabled logging and got some information. it seems that outlook can search the server. but something still wrong.

    below is the part of logging:

    [8/17/2012 15:11:59:950 P:3492 T:3576] CMsoIMProviderFactory::HrEnsureDefaultIMAppRegKeys Succeeded opening reg key (HKCU:SOFTWARE\IM Providers\)
    [8/17/2012 15:11:59:950 P:3492 T:3576] CMsoIMProviderFactory::HrEnsureDefaultIMAppRegKeys Succeeded querying reg key (HKCU:SOFTWARE\IM Providers\:DefaultIMApp:CSExeCOMServer)
    [8/17/2012 15:11:59:950 P:3492 T:3576] CMsoIMProviderFactory::HrEnsureDefaultIMProcessRegKey Succeeded opening reg key (HKCU:SOFTWARE\IM Providers\CSExeCOMServer)
    [8/17/2012 15:11:59:950 P:3492 T:3576] CMsoIMProviderFactory::HrEnsureDefaultIMProcessRegKey Succeeded opening reg key (HKLM:SOFTWARE\IM Providers\CSExeCOMServer)
    [8/17/2012 15:11:59:950 P:3492 T:3576] CMsoIMProviderFactory::WhichMessengerInProcessList Using (CSExeCOMServer.exe) process name for search
    [8/17/2012 15:11:59:965 P:3492 T:3576] <CMsoIMNAbstractionLayer::HrPostJob> <job:IMsoPresenceJobProviderConnect>
    [8/17/2012 15:11:59:965 P:3492 T:3576] <CMsoIMNALAsyncNotificationHandler::HrInitialize>
    [8/17/2012 15:11:59:965 P:3492 T:3576] </CMsoIMNALAsyncNotificationHandler::HrInitialize>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMNALAsyncNotificationHandler::DwThreadProc>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMNAbstractionLayer::HrOnJob> <job:IMsoPresenceJobInitialize>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMNAbstractionLayer::HrInitializeInternal>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMNAbstractionLayer::HrPostJob> <job:IMsoPresenceJobProviderConnect>
    [8/17/2012 15:11:59:965 P:3492 T:0856] </CMsoIMNAbstractionLayer::HrPostJob>  <job:IMsoPresenceJobProviderConnect>
    [8/17/2012 15:11:59:965 P:3492 T:0856] </CMsoIMNAbstractionLayer::HrInitializeInternal>
    [8/17/2012 15:11:59:965 P:3492 T:0856] </CMsoIMNAbstractionLayer::HrOnJob>  <job:IMsoPresenceJobInitialize>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMNAbstractionLayer::HrOnJob> <job:IMsoPresenceJobProviderConnect>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMNAbstractionLayer::HrEnsureIMApp>
    [8/17/2012 15:11:59:965 P:3492 T:3576] </CMsoIMNAbstractionLayer::HrPostJob>  <job:IMsoPresenceJobProviderConnect>
    [8/17/2012 15:11:59:965 P:3492 T:0856] <CMsoIMProviderFactory::HrGetAvailableProvider>
    [8/17/2012 15:11:59:965 P:3492 T:3576] <CMsoIMManager::HrAddEventCallback>
    [8/17/2012 15:11:59:965 P:3492 T:0856] CMsoIMProviderFactory::WhichMessengerInProcessList Using (CSExeCOMServer.exe) process name for search
    [8/17/2012 15:11:59:965 P:3492 T:3576] <CMsoPresenceCache::HrAddEventCallback>
    [8/17/2012 15:11:59:965 P:3492 T:3576] </CMsoPresenceCache::HrAddEventCallback>
    [8/17/2012 15:11:59:965 P:3492 T:3576] </CMsoIMManager::HrAddEventCallback>
    [8/17/2012 15:12:00:028 P:3492 T:0856] CMsoProviderOCom::IsMyProviderType !failed!  Line: 345  hr = 0x80004002
    [8/17/2012 15:12:00:028 P:3492 T:0856] OCOMIdentifyProvider !failed!  Line: 258  hr = 0x80004002
    [8/17/2012 15:12:00:028 P:3492 T:0856] CMsoIMProviderOC20::IsMyProviderType !failed!  Line: 117  hr = 0x80004002
    [8/17/2012 15:12:00:028 P:3492 T:0856] OC20IdentifyProvider !failed!  Line: 100  hr = 0x80004002
    [8/17/2012 15:12:00:028 P:3492 T:0856] <CMsoIMProviderWLive::HrInitialize>
    [8/17/2012 15:12:00:028 P:3492 T:0856] <CMsoIMProviderWLive::HrEnsureIMCallback>
    [8/17/2012 15:12:00:028 P:3492 T:0856] CMsoIMProviderWLive::HrEnsureIMCallback !failed!  Line: 307  hr = 0x80040200
    [8/17/2012 15:12:00:028 P:3492 T:0856] </CMsoIMProviderWLive::HrEnsureIMCallback !failed! hr = 0x80040200>
    [8/17/2012 15:12:00:028 P:3492 T:0856] CMsoIMProviderWLive::HrInitialize !failed!  Line: 262  hr = 0x80040200
    [8/17/2012 15:12:00:028 P:3492 T:0856] </CMsoIMProviderWLive::HrInitialize !failed! hr = 0x80040200>
    [8/17/2012 15:12:00:028 P:3492 T:0856] CMsoIMProviderFactory::HrGetAvailableProvider !failed!  Line: 432  hr = 0x80040200
    [8/17/2012 15:12:00:028 P:3492 T:0856] !!!Provider Initialization Failed!!!
    [8/17/2012 15:12:00:043 P:3492 T:3576] <CMsoIMManager::HrAddEventCallback>
    [8/17/2012 15:12:00:043 P:3492 T:3576] <CMsoPresenceCache::HrAddEventCallback>
    [8/17/2012 15:12:00:043 P:3492 T:3576] </CMsoPresenceCache::HrAddEventCallback>
    [8/17/2012 15:12:00:043 P:3492 T:3576] </CMsoIMManager::HrAddEventCallback>
    [8/17/2012 15:12:00:059 P:3492 T:0856] </CMsoIMProviderFactory::HrGetAvailableProvider !failed! hr = 0x80040200>
    [8/17/2012 15:12:00:059 P:3492 T:0856] CMsoIMNAbstractionLayer::HrEnsureIMApp !failed!  Line: 2238  hr = 0x80040200
    [8/17/2012 15:12:00:059 P:3492 T:0856] </CMsoIMNAbstractionLayer::HrEnsureIMApp !failed! hr = 0x80040200>
    [8/17/2012 15:12:00:059 P:3492 T:0856] CMsoPresenceJobProviderConnect::HrExecute !failed!  Line: 122  hr = 0x80040200
    [8/17/2012 15:12:00:059 P:3492 T:0856] CMsoIMNAbstractionLayer::HrOnJob !failed!  Line: 1806  hr = 0x80040200
    [8/17/2012 15:12:00:059 P:3492 T:0856] </CMsoIMNAbstractionLayer::HrOnJob !failed!  <job:IMsoPresenceJobProviderConnect> hr = 0x80040200>
    [8/17/2012 15:12:00:059 P:3492 T:0856] <CMsoIMNAbstractionLayer::HrOnJob> <job:IMsoPresenceJobProviderConnect>

    Friday, August 17, 2012 7:26 AM
  • error 0x80004002 means 'no such interface supported'. Apparently your exposed COM object does not implement some required interface. Either try to figure out which one or wait for someone with more experience in this topic, since i have none :-)

    Friday, August 17, 2012 7:36 AM
  • Hi,

    my class defined like below. and those methods of interface implemented automatically, I do not add any code to the method.

    [ComSourceInterfaces(typeof(DMessengerEvents))]

    [Guid(SimpleObject.ClassId), ComVisible(true)]

    [TypeLibType(11)]

    [ClassInterface(ClassInterfaceType.None)]

    public class SimpleObject : IMessenger4, Messenger, DMessengerEvents_Event, IMessengerDebug

    {

    ....................

    }

    I do not know how can I do now.

    please help me.

    thank you very much.


    • Edited by richar1980 Friday, August 17, 2012 8:19 AM
    Friday, August 17, 2012 8:07 AM
  • The process you see in the logs is Office trying to determine what type of IM provider you are.  Let's call this phase "Provider Discovery".  As you can see Office asks if you are a OCOM provider, followed by a OC20 provider, and so on.  If you are following the online article you list above then you want to be known as a OC20 provider.  However because you don't implement IMessengerAdvanced, Office moves on and tries to determine if you are a Windows Live IM provider.  Make sure you implement ALL IMessenger* interfaces including IMessengerAdvanced.  That should get you past this hurdle.

    Also, in regards to general IM provider integration make sure you review all the posts I have responded to regarding this topic thus far.  This should be helpful to you.

    HTH,

    Dave

    ** Note: I using the term 'Office' on purpose because the IM integration is done in a shared component between all of the office apps.  Therefore, if you get this working in one Office app it should work in all.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members.

    Tuesday, September 4, 2012 1:07 PM
  • Dave,

    thanks for you reply.

    Now, my Messenger implemented the function GetAuthenticationInfo and return below value:

    CComBSTR AuthoString;
            AuthoString = ("<authenticationinfo><protocol>sip_kerberos</protocol></authenticationinfo>");
            *pbstrAuthInfo = AuthoString.Detach();

            return S_OK;

    but it seems that after outlook2010 get this value, outlook does not call other method. like get_services, GetContact etc. I think the return value is not corrent.

    Could you tell me which value I should return.

    thanks.

    Tuesday, September 11, 2012 6:14 AM