0

I'm in the process of migrating my development pc from Windows XP (Professional, SP3, x86) to Windows 7 (Professional, SP1, x86). The source of the application I'm working on is exactly the same on both machines, but fails on the Windows 7 machine when initiating an RDOSession.

// Initialize the session.
_session = new RDOSession(); // Throws exception...
_session.LogonExchangeMailbox("mailbox@mydomain.com", "mail.mydomain.com");

This piece of code results in the following exception:

System.Runtime.InteropServices.COMException was caught
  Message=Creating an instance of the COM component with CLSID {29AB7A12-B531-450E-8F7A-EA94C2F3C05F} from the IClassFactory failed due to the following error: 8004010e.
  Source=mscorlib
  ErrorCode=-2147221234
  StackTrace:
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Activator.CreateInstance(Type type)
       at (...).DataAccess.ExchangeManager..ctor(ExchangeConfigurationSettings configurationSettings) in D:\Development\WIP\(...)\DataAccess\Exchange\ExchangeManager.cs:line 57

Obviously I directy think about MAPI/CDO, so I checked that extensively and tried Win7 with both Office 2007 and 2010 too, but no luck. My current configuration is as follows:

  • WinXP: VS2010SP1, officeless, but installed with Exchange MAPI and CDO and Redemption version 5.5.0.3218.
  • Win7: VS2010SP1, officeless, but installed with Exchange MAPI and CDO and Redemption version 5.5.0.3218.

Anyone got a clue? Thanks in advance!

Calon
  • 4,174
  • 1
  • 19
  • 30
Herman Cordes
  • 4,628
  • 9
  • 51
  • 87

1 Answers1

1

The error is MAPI_E_NOT_ENOUGH_RESOURCES, which usually means that MAPI system could not initialize itself. When and where does your code run?

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Ok! Does it mean to little memory resources? This pc does have 4 GB of RAM. In answer on your questions, the code runs on the mentioned Win7-pc in a Visual Studio debug environment. And when? Only when I press 'Run'. – Herman Cordes Aug 21 '13 at 08:41
  • But what kind of app is that? ASP.Net? Service? Console app? GUI app? Do you get the same error if you run the app from Windows Explorer instead of the VS IDE? – Dmitry Streblechenko Aug 21 '13 at 17:41
  • It is a Console application on .NET Framework 4. And actually I do get the same error when running without debugging. – Herman Cordes Aug 22 '13 at 06:32
  • I can only suggest to try to run Process Monitor from SyssInternals and check if there are any failures accessing files or registry. – Dmitry Streblechenko Aug 23 '13 at 20:44
  • I'll try this tomorrow, I'll let you know, thanks for the help. – Herman Cordes Aug 26 '13 at 12:26
  • Allright, tested with Process Monitor some stuff and that eventually resulted in me checking the code that provides impersonation. My preliminary conclusion is this error is due to the fact I impersonated using logon type LOGON32_LOGON_INTERACTIVE (which works on WinXP). Changing the type to LOGON32_LOGON_NEW_CREDENTIALS got the code running on Win7 at least. I'll have to perform some additional tests to make sure this solution also lasts in production environments. – Herman Cordes Aug 27 '13 at 06:05