We help IT Professionals succeed at work.
Get Started

CDO and Windows Service

Last Modified: 2013-11-26
I have a windows service that I'm installing on a server.  The service uses CDO to iterate through mail items in a public folder.  The CDO code works fine in a windows forms application that I've been using to debug it.  The service works fine as far as starting, stopping and writing to the event log.

However, when I put the CDO related code into the service, it's as if it is completely ignored.  No error messages, no unexpected service stops or anything.  It just doesn't perform.

For instance:  I had the code I needed executed on the elapsed event for a timer.  On elapsed, the service would write a test entry to the event log, then try to access the public folder, then write the number of messages in the folder to the event log.  Neither eventlog entry was added.  However, when I moved the CDO code into a separate procedure and called it from the OnElapsed event (leaving the first event log entry in the event itself) the first entry would be added to the event log, and then nothing.  The service would continue to run, the timer continues to loop adding the initial event log every ten seconds, but the CDO code never goes anywhere.

Any ideas?
Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE