Exception is thrown when i try to create Outlook object.

A

Abhishek Singh

Exception is thrown when i try to Create Outlook object using windows service.

I have written a windows service which OnContinue event, Calls a function in
a class library which creates Outlook objec, as throws Exception "Retrieving
the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following error:
80080005."

But when i call the same function from window application object is created
and code performs exacltly the same it is expected to, but throws exception
when called with window service.

refer code snippets for reference.

Outlook.Application OL = new Outlook.ApplicationClass();
Outlook.NameSpace NS = OL.GetNamespace("MAPI");

PS: I have kept the Bussness logic in a different class library and
referencing it to windows service. I have not written any buissness logic in
windows service, i am just calling function inside the buissness logic.

Please help, Thanks in Anticipation
 

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