none
Error While Calling Dll function through windows services Retrieving the COM class factory for component with CLSID

    Question

  • Hi 

    I have created a simple windows service in that service i am calling  some other dll function ,In that dll i am creating RDOSession object using Third party Redemption.dll   it throws the Following exception 

    I have selected Installer account type : Local system

    Modifier :Public 

    Erorr:

    {System.IO.FileNotFoundException: Retrieving the COM class factory for component with CLSID {29AB7A12-B531-450E-8F7A-EA94C2F3C05F} failed due to the following error: 8007007e.}

    Note : But we we call that function through normal application instead of windows service it runs properlly .Is there any changes do special 

    Thursday, February 21, 2013 8:14 AM

Answers

  • Hi Rohidas,

    Thank you for posting in the MSDN Forum.

    The below reply is from Ken seen in this page.

    That is the CLSID for RDOSession. So either something is blocking that object creation or the CLSID isn't correctly or fully registered or installed where expected. That error message is usually a FileNotFoundException.

    Check in your registry for that CLSID in HKCR\CLSID\ and make sure it's correct and points to the corrct location in the InprocServer32 subkey. Try registering it again, check your permissions to create objects, see if new works for other applications.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 26, 2013 6:23 AM
    Moderator
  • Additional newer advice would be to consider using the RedemptionLoader class and deploying Redemption to the installation folder. That allows use of Redemption without COM registration, using calls to the RedemptionLoader class.

    Also, when run from a Windows service the code cannot use any Outlook object model objects. The MAPI loaded on that machine should be from the standalone MAPI download (only supports ANSI PST files, BTW). The MAPI from Outlook should not be installed, and usually it's best if Office has never been installed on that machine.

    The account used to run the service of course needs permissions to access whatever mailboxes or folders it needs to work with.


    Ken Slovak MVP - Outlook

    Tuesday, February 26, 2013 9:32 PM
    Moderator

All replies

  • 

    Hi ,

     I created the RDOSession object in my dll and I am calling that dll function  through windows services, I added redemption.dll  references in my services and in dll also but throws the exception  

    Here is code below I written

    RDOSession      f_objSession        = new Redemption.RDOSession();

    Error :

    Message : {"Retrieving the COM class factory for component with CLSID {29AB7A12-B531-450E-8F7A-EA94C2F3C05F} failed due to the following error: 8007007e.":null}  

    Note : Same code I running if I run as a normal application . is there any special changes need to do .Please help me 

    Thursday, February 21, 2013 11:41 AM
  • The error is ERROR_MOD_NOT_FOUND

    What is the full name of the directory where Redemption is installed?

    When you installed the dll using regsvr32.exe, were you running as a local admin with UAC turned off to make sure Redemption can register itself in HKLM instead of HKCU?

    Is using RedemptionLoader (http://www.dimastr.com/redemption/security.htm#redemptionloader ) an option?

    Also keeep in mind that if you run your service under the Local System account, there won't be any profiles present, so you will not be able to use RDOSession.Logon. RDOSesssion.LogonExchangeMailbox also will not work since your code needs to run under the identity of a domain user to authenticate with the server.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!



    Thursday, February 21, 2013 1:46 PM
  • Hi Rohidas,

    Welcome to the MSDN Forum.

    I have moved this thread to Outlook forum for more responses.

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 22, 2013 4:39 AM
  • Full directory name "D:\Work_Area"  and  have Map drive With X: so registered Redemption.dll with "X:\Binaries\Redemption.dll ". it work with normal window application.

    UAC is Off  position and when we register the Redemption.dll it get register under HKLM

    not using Redemption Loader option .

    my system is under Exchange domain and login with an admin credential. Same code  run with Windows application and able to connect to exchange mailboxes  and also able to create the RDO Session object

    but only problem when same code run through windows services.

    Regards,

    Rohidas 

    Friday, February 22, 2013 6:25 AM
  • What identity is the code running under for the service? If it's not a login that has an Exchange logon and permissions to log into each mailbox your code will fail. You should set up the service to run under an identity that has those permissions and an Exchange logon.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Rohidas Jasud" <=?utf-8?B?Um9oaWRhcyBKYXN1ZA==?=> wrote in message news:50942b1f-9611-421f-8ba7-5e0df1dc07cc...

    Full directory name "D:\Work_Area"  and  have Map drive With X: so registered Redemption.dll with "X:\Binaries\Redemption.dll ". it work with normal window application.

    UAC is Off  position and when we register the Redemption.dll it get register under HKLM

    not using Redemption Loader option .

    my system is under Exchange domain and login with an admin credential. Same code  run with Windows application and able to connect to exchange mailboxes  and also able to create the RDO Session object

    but only problem when same code run through windows services.

    Regards,

    Rohidas 


    Ken Slovak MVP - Outlook
    Friday, February 22, 2013 3:52 PM
    Moderator
  • Can the user that runs teh service access that folder? Can you place a TXT file in that folder (X:\Binaries) and read it from the service?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Friday, February 22, 2013 8:25 PM
  • Sir,

    I have changed the Redemption.dll refernces path Instead of X:\Binaries, added the D:\WorkArea Path and after that start the service and  able to create the  RDOSession Object and LogonExchangeMailbox  

    but facing the problem with RDOStore Object :

    Here is Code that written 

    RDOStore f_objStore = f_objSession.GetSharedMailbox(UserName);

    Exception :

    {"Error in IMAPISession::OpenMsgStore(pbExchangeProviderPrimaryUserGuid): MAPI_E_FAILONEPROVIDER\r\nulVersion: 0\r\nError: Microsoft Exchange is not available.  Either there are network problems or the Exchange computer is down for maintenance.\r\nComponent: Microsoft Exchange Information Store\r\nulLowLevelError: 2147746069\r\nulContext: 1318"}


    Note : I am runing windows services with exchange admin credential ,and it work if we run application without services 

    Monday, February 25, 2013 7:29 AM
  • Local system does not have network access
    Monday, February 25, 2013 8:15 AM
  • Exchange admin does not have access to any mailboxes unless you explicilty gave the admin access rights.

    Call LogonExchangeMailbox for the current user (the Exchange admin); if you need to open other mailboxes, call RDOSession.GetSharedMailbox.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Monday, February 25, 2013 1:59 PM
  • Sir ,

    We have given admin access right to that mailboxes ,and call the RDOSession.GetSharedMailbox(UserName ) for that user but same error occurs .  

    Tuesday, February 26, 2013 6:19 AM
  • Can you send an email to dmitry at dimastr dot com? I wil send you the debug version of the dll...

    Thanks!


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, February 26, 2013 6:23 AM
  • Hi Rohidas,

    Thank you for posting in the MSDN Forum.

    The below reply is from Ken seen in this page.

    That is the CLSID for RDOSession. So either something is blocking that object creation or the CLSID isn't correctly or fully registered or installed where expected. That error message is usually a FileNotFoundException.

    Check in your registry for that CLSID in HKCR\CLSID\ and make sure it's correct and points to the corrct location in the InprocServer32 subkey. Try registering it again, check your permissions to create objects, see if new works for other applications.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 26, 2013 6:23 AM
    Moderator
  • Additional newer advice would be to consider using the RedemptionLoader class and deploying Redemption to the installation folder. That allows use of Redemption without COM registration, using calls to the RedemptionLoader class.

    Also, when run from a Windows service the code cannot use any Outlook object model objects. The MAPI loaded on that machine should be from the standalone MAPI download (only supports ANSI PST files, BTW). The MAPI from Outlook should not be installed, and usually it's best if Office has never been installed on that machine.

    The account used to run the service of course needs permissions to access whatever mailboxes or folders it needs to work with.


    Ken Slovak MVP - Outlook

    Tuesday, February 26, 2013 9:32 PM
    Moderator