Redemption and Outlook 2007

M

MA

Hi Guys,

I have written a solution which works fine in Outlook 2003 & 2007. I
have decided to upgrade the redemption from "4.4.0.714" to "4.6.0.924"
and the solution unable to work in Outlook 2007. It works fine in
Outlook 2003.

Please see below the error message...

<Exception Text>
System.Runtime.InteropServices.COMException (0x8000FFFF): Interface
not supported
at Redemption.IRDOSession.set_MAPIOBJECT(Object Value)
at RedemptionTester.Form1.InitRDOObjects(Application olApp)
at RedemptionTester.Form1.button1_Click(Object sender, EventArgs e)
</Exception Text>

Please see below the test code which failes in Outlook 2007...

<code>
private void button1_Click(object sender, EventArgs e)
{
Outlook.Application olApp = null;
Outlook.NameSpace olNameSpace = null;
try
{
if (olApp == null)
olApp = new Outlook.ApplicationClass();

System.Windows.Forms.Application.DoEvents();

if (olNameSpace == null)
olNameSpace = olApp.GetNamespace("MAPI");

InitRDOObjects(olApp);
}
finally
{
Marshal.ReleaseComObject(olApp);
olApp = null;

Marshal.ReleaseComObject(olNameSpace);
olNameSpace = null;
}
}


/// <summary>
/// Initialize the objects
/// </summary>
private void InitRDOObjects(Outlook.Application olApp)
{
Redemption.RDOSession rdoSession = null;
Type type = Type.GetTypeFromProgID("XYZ.RDOSession");
rdoSession = (RDOSession)Activator.CreateInstance(type);
rdoSession.AuthKey = "MYKey";
rdoSession.MAPIOBJECT = olApp.Session.MAPIOBJECT;
}
</code>

Has anyone seen this behaviour? Thanks for your response.

Regards,
MA
 
D

Dmitry Streblechenko

Is Outlook running aat teh time your code is executing?
Are you sure olApp.Session.MAPIOBJECT is not null?
Do you happen to have Exchange Server or Exchange Admin console installed on
the same machine?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
M

MA

Thanks for your response.
Is Outlook running aat teh time your code is executing?

No. I have also confirmed in Task Manager no Outlook processes was
running.

Are you sure olApp.Session.MAPIOBJECT is not null?
MAPIOBJECT not null. See the updated code below where prompt to
Outlook Application.name and prompt to the MAPIOBJECT null value.

<code>
private void InitRDOObjects(Outlook.Application olApp)
{
MessageBox.Show(olApp.Name);

if (olApp.Session.MAPIOBJECT == null)
MessageBox.Show("MAPIOBJECT is empty");
else
MessageBox.Show("MAPIOBJECT not empty"); // <- Program execute
this line

Redemption.RDOSession rdoSession = null;
Type type =
Type.GetTypeFromProgID("XYZ.RDOSession");
rdoSession =
(RDOSession)Activator.CreateInstance(type);
rdoSession.AuthKey = "MYKey";
rdoSession.MAPIOBJECT =
olApp.Session.MAPIOBJECT; // <- Fall over here
}
Do you happen to have Exchange Server or Exchange Admin console installed on
the same machine?

No.

OS: Win XP
Outlook client: 2007 (12.0.6316.500)

Regards,
MA
 
M

MA

On a separate note, I have tried to test the code in VBS.
Interestingly, it works in Outlook 2007.

<code>
dim oNmSpaceObj
dim oOutlookObj

Set oOutlookObj = CreateObject("Outlook.Application")

set oRDOSession = CreateObject("XYZ.RDOSession")
oRDOSession.AuthKey = "MYKey"
oRDOSession.MAPIOBJECT = oOutlookObj.session.MAPIOBJECT

msgbox oRDOSession.ProfileName

set oOutlookObj = nothing
set oRDOSession = nothing
</code>

Not sure why the equivalent C# .NET not working. Any idea?

Regards,
MA
 
M

MA

I have performed more testing with some positive results. It appear
the issue could be relate to the registry of the machine or some other
issue. Please see below the test results:

I have always installed and register the "Redemption.dll" to "C:
\Program Files\Our Company\External Extensions".

Results:
- It appear in the Outlook 2007 Virtual machine, the solution
throw the error above if the "Redemption.dll" installed to the
specific folder. If install and register the "Redemption.dll" to
another folder (i.e. "c:\test") then the solution works fine.
- If I install and register the ""4.4.0.714" of the
"Redemption.dll" to the "C:\Program Files\Our Company\External
Extensions" then the solution works fine.

It could be some registry reference which causing the issue. I have
searched the registry and unable to locate any reference. Any
suggestions?

BTW, I used the distributable version of Redemption.

Regards,
MA
 
D

Dmitry Streblechenko

Send an e-mail to my private address and I will send you a special debug
version that creates a LOG file.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top