Outlook Security / Service Problem

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Security / Service Problem
 
Jeremy


Guest


I am writing a Windows service utilizing Outlook and the Outlook Security Manager.

When I start the service, I disable Outlook Security and send an email. I then re-enable Outlook Security, release my COM objects and free variables in my Finally block.

The next time the service processes the Sub, I am able to create the new Outlook object and connect to it using the ConnectTo method of the Outlook Security object, but when I attempt to call the Check method it fails with an error:
Unspecified error
at AddinExpress.Outlook.IOutlookSecurityManager.Check(Int32 apiType)
at AddinExpress.Outlook.SecurityManager.Check(osmWarningKind kind)

A very similar error is thrown if I attempt to DisableOOMWarnings without the Check call:
Unspecified error
at AddinExpress.Outlook.IOutlookSecurityManager.Check(Int32 apiType)
at AddinExpress.Outlook.SecurityManager.set_DisableOOMWarnings(Boolean value)

I create the Outlook Security Manager object using:
Dim SecMan As New AddinExpress.Outlook.SecurityManager

I free the Outlook Security Manager object in the Finally block using:
SecMan.DisableOOMWarnings = False
SecMan.Dispose()
SecMan = Nothing

'Iterate through Outlook objects using code such as:
If Not IsNothing(oOutlook) Then
oOutlook.Quit()
While (System.Runtime.InteropServices.Marshal.ReleaseComObject(oOutlook) > 0)
End While
oOutlook = Nothing
End If

'Call Garbage Collection:
GC.Collect()
GC.WaitForPendingFinalizers()

'Sleep recommended by a MS KB article
System.Threading.Thread.Sleep(5000)

I have searched your forum and documentation for a different or recommended way to free the Outlook Security Manager object, but have not found any information. Any ideas what could be causing this error? I can attach or post any additional code as necessary. Thank you for your help.

Sincerely,
Jeremy
Posted 10 Mar, 2005 14:22:23 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Jeremy.

Now we are looking for the cause of the error. Your code would be very useful for us. Could you send us your project?

Besides, did you read this article: http://support.microsoft.com/?kbid=237913.
Posted 11 Mar, 2005 03:09:34 Top
Guest


Guest


Yes I will gladly send you the project files. It is a Proof of Concept program taken from my original for simplicity.

Unfortunately I am familiar with that KB article. However, we are attempting to automate several Outlook features that I have been unable to do otherwise.

Thank you for your reply,

Jeremy
Posted 11 Mar, 2005 10:24:11 Top
Eugene Starostin


ADX Team
Add-in Express team


Posts: 430
Joined: 2004-04-05
Hello Jeremy,

Have you tested our sample project?
Posted 14 Mar, 2005 14:52:38 Top
Jeremy


Guest


I have used the files you sent with great success! Thank you so much for the fast response and fix. You have a great product! It is nice to work with such an effective and responsive company.

Jeremy
Posted 22 Mar, 2005 09:59:32 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Jeremy.

Thanks a lot for your good words.
Posted 23 Mar, 2005 03:59:40 Top