I am trying to display the SelectNamesDialog in Outlook 2010, using Redemption in C#, but I am getting the exception "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." on the third line below:
RDOSession rdoSess = new RDOSession();
rdoSess.MAPIOBJECT = Reflection.GetProperty(Application.Session, "MAPIObject");
RDOSelectNamesDialog dlg = rdoSess.GetSelectNamesDialog();
My Outlook application object is valid (the standard SelectNamesDialog works ok) and I am using reflection to get the MAPIObject property from the session as it does not appear in the intellisense.
I have downloaded the latest version of Redemption and have referenced the Interop.Redemption file. I am running Windows 7 32-bit and Visual Studio 2010, using the .NET 4 Framework.
Has anyone else seen this error before? I suspect I am doing something wrong, but my code seems to match the Redemption samples I have found online.
Any help would be gratefully received!
Thanks in advance,
Nathan.